home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 4 / Gold Medal Software - Volume 4 (Gold Medal) (1994).iso / netutils / brir110e.arj / DOC.ZIP / CRYSTAL.TXT next >
Text File  |  1994-06-11  |  160KB  |  3,840 lines

  1. Part Five: Crystal Reports
  2.  
  3.  
  4. 26.0 Introduction to Crystal Reports
  5.  
  6. This chapter introduces Crystal Reports, shows you how to start the 
  7. program, introduces you to some of the things the program can do, and 
  8. familiarizes you with some of the "nuts and bolts" of using the program.
  9.  
  10. 26.1 About This Part of the Manual
  11.  
  12. This part of the manual contains all of the information you should need 
  13. for building reports quickly and easily using Crystal Reports. It is 
  14. divided into three chapters:
  15.  
  16. Chapter                                 Description
  17. 26.0 Introduction to Crystal Reports    Introduction gives you a brief 
  18.                     overview of Crystal Reports. It 
  19.                     familiarizes you with the Crystal 
  20.                     Reports screens, using the mouse, 
  21.                     error messages, and the help 
  22.                     facility.
  23.  
  24. 27.0 Using Crystal Reports              This chapter conceptually leads you 
  25.                     through the process of creating a 
  26.                     report with Crystal Reports. It 
  27.                     suggests a methodology for creating 
  28.                     reports starting with nothing more 
  29.                     than a one sentence statement of 
  30.                     purpose for the report. 
  31.  
  32. 28.0 Practical Crystal Reports          Practical Crystal Reports is a 
  33.                     "How to" chapter. It contains a 
  34.                     variety of report creation topics 
  35.                     and additional information on the 
  36.                     practical aspects of using Crystal 
  37.                     Reports to solve typical reporting 
  38.                     problems. 
  39.  
  40.  
  41. For information on topics not found in these chapters, refer to the 
  42. Crystal Reports Help system.
  43.  
  44. This part of the manual assumes that you understand the basic concepts 
  45. and usage of Microsoft DOS or PC-DOS, and Windows 3.0 or higher. The 
  46. procedures also assume that you will be using a mouse in the creation of 
  47. your reports. While the instructions occasionally indicate keyboard 
  48. methods for using the program, the instructions are generally 
  49. mouse-oriented since most Windows users have a mouse.
  50.  
  51. 26.1.1 Special Notations Used in this Part
  52.  
  53. The following notations are used throughout this part of the manual:
  54.  
  55. o  Delete means the Del key on your numeric keypad.
  56.  
  57. o  Escape means the Escape or Esc key on your keyboard.
  58.  
  59. o  Enter means the Enter, Return, or CR key, depending on which of these 
  60. keys appears on your keyboard.
  61.  
  62. o  Click means to click the left mouse button one time.
  63.  
  64. o  Double click means to click the left mouse button twice, in quick 
  65. succession.
  66.  
  67. o  The term Cursor Keys means the Pg Up, Pg Dn, and Arrow Up, Arrow Down, 
  68. Arrow Right, Arrow Left, Home, and End keys on your numeric keypad.
  69.  
  70. o  Ctrl+Key, Shift+Key, and Alt+Key are examples of the notation for two 
  71. key combinations. They mean to press the first key in the combination 
  72. (Control, Shift, or Alt), and, while keeping it depressed, to press the 
  73. second key in the combination (designated as Key).
  74.  
  75. o  Text enclosed in double brackets (for example, << information >>) is 
  76. intended to expand or explain the information that it follows.
  77.  
  78. o  Field names in formulas are italicized.
  79.  
  80. o  Insert|Formula means to select the Formula option from the Insert menu.
  81.  
  82. o  Drag, when used in talking about field boxes, means to position the 
  83. cursor on a field box, depress the left mouse button, and keep the button 
  84. depressed while moving the field to a new position.
  85.  
  86. o  Drag, when used in talking about text, means to depress the left mouse 
  87. button and, while it is depressed, move the I-beam cursor across the text 
  88. of interest to highlight and thus select it.
  89.  
  90. o  Computer type indicates data that you are to enter using the computer 
  91. keyboard. It is also used to show example formulas.
  92.  
  93.  
  94. 26.2 Starting Crystal Reports
  95.  
  96. You can start Crystal Reports in two ways:
  97.  
  98. o  from the DOS command line
  99. o  from the Windows environment.
  100.  
  101. 26.2.1 From DOS
  102.  
  103. To start Crystal Reports (and Windows at the same time) from the DOS 
  104. command line, type:
  105.  
  106.     cd
  107.  
  108. and the name of the directory into which you installed Crystal Reports. 
  109. For example, if you installed Crystal Reports in the default Crystal 
  110. Reports directory, type:
  111.  
  112.     cd \CRW
  113.  
  114. and then press Enter.
  115.  
  116. At the prompt, type:
  117.  
  118.     win CRW
  119.  
  120. and press Enter. Windows and Crystal Reports are both started.
  121.  
  122. 26.2.2 From Windows
  123.  
  124. Once in Windows, select the group window that holds the Crystal Reports icon.
  125.  
  126. o  If you're using a mouse, double click on the Crystal Reports icon to 
  127. start the program.
  128.  
  129. o  If you're using the keyboard, use the arrow keys to select the icon and 
  130. then press Enter.
  131.  
  132. You can also start Crystal Reports from within Windows by double clicking 
  133. on the file name CRW.EXE in the File Manager.
  134.  
  135. 26.2.3 The Crystal Reports Registration Dialog Box
  136.  
  137. The Crystal Reports Registration dialog box appears whenever you start 
  138. Crystal Reports unless you have registered your copy of the program with 
  139. the company, received a serial number, and entered it in the Enter serial 
  140. number... edit box to disable this opening dialog box.
  141.  
  142. There are two good reasons to register your copy of Crystal Reports:
  143.  
  144. o  Registration entitles you to technical support should you ever require 
  145. assistance in using the product.
  146.  
  147. o  Registration assures you that you will be notified whenever the 
  148. product is upgraded to offer new features, benefits, and efficiencies.
  149.  
  150. The Crystal Reports Registration dialog box options are as follows:
  151.  
  152. o  Enter serial number... edit box: Use this edit box to enter the 
  153. serial number that Crystal Services sends you when you register the 
  154. program. Be careful to enter the serial number correctly.
  155.  
  156. o  Proceed to Crystal Reports button:  Use this button to close out 
  157. the dialog box and go directly into the Crystal Reports program. The 
  158. button will be useful until you receive and enter your registration 
  159. serial number. At that time the Crystal Reports Registration dialog box 
  160. will no longer appear when you start the program.
  161.  
  162. o  Edit Registration Info button:  Use this button to enter/edit product 
  163. registration information. The Edit Registration Info button takes you to 
  164. the Crystal Reports Registration dialog box. Use this dialog box to enter 
  165. your name, company name, and phone and fax numbers. Crystal Reports stores 
  166. this information and displays it and/or prints it out automatically when you 
  167. print out the registration form, call up system information (via the 
  168. Help|System Information command), or send in a technical support request 
  169. (via the Help|Technical Support Request command).
  170.  
  171. o  Print Registration Form button:  Use this button to print a copy of 
  172. the completed registration form.
  173.  
  174. 26.2.4 How to Register Your Copy of Crystal Reports
  175.  
  176. Use the following procedure to register your copy of Crystal Reports.
  177.  
  178. 1.  Click the Edit Registration Info button. 
  179.  
  180.     The Crystal Reports Registration dialog box appears.
  181.  
  182. 2.  Enter your name, address, phone, and fax in the edit boxes provided, 
  183.     and click OK when finished
  184.  
  185.     You are returned to the Crystal Reports Registration dialog box.
  186.  
  187. 3.  Click the Print Registration Form button. 
  188.  
  189.     Crystal Reports prints out a copy of your completed registration form.
  190.  
  191. 4.  Fax the form to Crystal Services at the number that appears on the 
  192.     form, or mail it to Crystal Services at the address that appears on 
  193.     the form.
  194.  
  195. 5.  In a few days, the company will mail or fax you back your serial number.
  196.  
  197. 6.  Enter the serial number in the Enter serial number... edit box, and 
  198.     click the Proceed to Crystal Reports button when finished. 
  199.  
  200.     This takes you to Crystal Reports and disables the dialog box so it no 
  201.     longer appears when you start the program. 
  202.  
  203.  
  204. 26.3 Quick Start
  205.  
  206. If you are an experienced Windows user who wants to get right into the 
  207. program, follow these steps to set up a Crystal Reports report for the 
  208. first time after you install the program.
  209.  
  210. 1.  Start Crystal Reports by double clicking on the Crystal Reports icon 
  211.     in the Program Manager.
  212.  
  213. 2.  Select New Report from the File menu.
  214.  
  215. 3.  When the Choose Database File dialog box appears, select the first 
  216.     database you want to activate for your report and press OK when finished. 
  217.  
  218.     The Crystal Reports Report Editor appears with Page Header, Details, 
  219.     and Page Footer sections set up on your report template. The sections 
  220.     are all blank initially. 
  221.  
  222.     Create your report by inserting and formatting items in each of 
  223.     these sections.
  224.  
  225. 4.  The Insert Database Field dialog box appears on screen with the Report 
  226.     Editor. 
  227.  
  228.     The Insert Database Field dialog box displays a list of all of the 
  229.     fields in the active database. To speed the entry of multiple fields, 
  230.     the box remains on screen until you click on the Done button. You can 
  231.     move the dialog box to a new location if you wish. 
  232.  
  233. 5.  Select the first field you want to appear on the report. 
  234.  
  235.     A rectangular insertion cursor appears. 
  236.  
  237. 6.  Position the cursor at the point in the Details section where you want 
  238.     your field to appear, and click the left mouse button to enter it. 
  239.  
  240.     Crystal Reports marks the field position with a rectangular box. The 
  241.     characters in the box indicate whether the field is text (XXX...), 
  242.     number (555,...), dollar value ($555,...) date (YYYY-M...), or 
  243.     Boolean (T/F). The number of characters in the box indicate the 
  244.     number of characters allowed for the field in the database from which 
  245.     it came.
  246.  
  247. 7.  Repeat Steps 5 and 6 until you have placed all the fields you want to 
  248.     place.
  249.  
  250. 8.  To create a title, select Insert|Text Field, type in the information 
  251.     you want to appear, click Accept when finished, and position the field 
  252.     where you want it in the Page Header section. 
  253.  
  254.     You can also insert database fields or special fields in that section 
  255.     from the Insert menu. 
  256.  
  257. 9.  To see how your results will print, select Print To Window from the 
  258.     Print menu. Close the window when you are finished with your review.
  259.  
  260. 10. If you want to:
  261.  
  262.     o  change the placement or width of a field
  263.     o  format the field
  264.     o  insert a subtotal or grand total for a field
  265.     o  delete a field
  266.  
  267.     click the field box for that field. Black handles appear on the right 
  268.     and left sides of the field box to indicate that it has been selected.
  269.  
  270.     o  To change the placement of the field, drag the field box to 
  271.     its new position using the mouse or the arrow keys. The arrow keys 
  272.     move the field box one grid position each time you press them.
  273.  
  274.     o  To change the width of the field, drag the right or left handle 
  275.     using your mouse or use a Shift-Arrow combination on your keyboard.
  276.  
  277.     o  To format or subtotal the field, click the right mouse button 
  278.     while the cursor is inside the field. A pop-up menu appears listing 
  279.     your various options.
  280.  
  281.         -  To change the font, select Change Font and refine 
  282.         your selection using the Font dialog box when it appears.
  283.  
  284.         -  To change the format (alignment within field; number, 
  285.         currency, or date display; etc.) select Change Format and 
  286.         refine your selection using the Field Format dialog box 
  287.         when it appears.
  288.  
  289.         -  To insert a subtotal, select Insert Subtotal and refine 
  290.         your selection using the Insert Subtotal dialog box when 
  291.         it appears. In this dialog box you select the field and the 
  292.         condition that triggers a new subtotal whenever the field's 
  293.         value changes, and you select the sort direction: Ascending 
  294.         (A to Z, 1 to 9) or Descending (Z to A, 9 to 1). The 
  295.         program creates a new section to hold the subtotal.
  296.  
  297.     NOTE:  The program automatically sorts the data (based on the field 
  298.     that triggers the subtotals) before it subtotals. Manually entering 
  299.     a subtotal sort is not necessary.
  300.  
  301.         -  To insert a grand total, select Insert Grand Total. The 
  302.         program creates a new section to hold the grand total.
  303.  
  304.         -  To delete the field, select Delete Field.
  305.  
  306. 11. To create a formula to make data calculations or comparisons, select 
  307.     Formula Field from the Insert menu. 
  308.  
  309.     Enter a name for your formula in the Insert Formula dialog box, and 
  310.     enter the formula itself in the Formula Editor when it appears. Enter 
  311.     fields, operators, and functions by selecting them from their respective 
  312.     scroll lists. 
  313.  
  314.     You can get complete information on each available Function and 
  315.     Operator via the Help button, and you can check your formula syntax 
  316.     via the Check button. Entering a Crystal Reports formula is similar to 
  317.     entering a formula in a spreadsheet cell. When finished editing, 
  318.     select Accept and place the formula just like you do a database field.
  319.  
  320. 12. To change the sort order, select Record Sort Order from the print menu.
  321.  
  322.     Select the field(s) you want Crystal Reports to use for sorting the 
  323.     report data.
  324.  
  325. 13. To change the sort and group by field, select Group Section from the 
  326.     Edit menu. 
  327.  
  328.     Select the group section of interest from the list that appears in the 
  329.     Edit Group Section (sections) dialog box, and select the new "trigger" 
  330.     field from the Edit Group Section (edit) dialog box when it appears.
  331.  
  332. 14. If you want to limit your report to specific records (for example, 
  333.     the records of California customers that have YTD sales greater 
  334.     than $10,000), click the first field on which you want your selection 
  335.     to be based (in this case the State field) and choose Select Records 
  336.     from the Print menu or the right mouse button pop-up menu. 
  337.  
  338.     Answer the questions that appear in the Select Records dialog box and 
  339.     click OK when finished. If your selection is based on more than one 
  340.     field, repeat the process with the remaining field(s) until you have 
  341.     completed entering your selection specifications.
  342.  
  343. 15. When finished, you can print your report by selecting Print To Printer 
  344.     from the Print menu.
  345.  
  346.  
  347. 26.4 About Crystal Reports
  348.  
  349. Crystal Reports is a powerful yet easy to use program for creating custom 
  350. reports, lists, and form letters using data from your existing databases. 
  351. The program works by establishing connections with one or more of your 
  352. databases. 
  353.  
  354. Using these connections as conduits, Crystal Reports draws in the values 
  355. from database fields you select and uses them in the report, either in 
  356. their original form or as part of a formula that generates more 
  357. sophisticated values.
  358.  
  359. Crystal Reports was designed to work with all kinds of data: numbers, 
  360. currency, text, dates, and Boolean (Yes/No) fields. It has a wide range of 
  361. built-in tools that you can use to manipulate that data to fit your needs. 
  362. Using these tools, you can:
  363.  
  364. o  make calculations and comparisons of data values,
  365. o  calculate subtotals, and grand totals of field values,
  366. o  calculate group averages, count the records in a group, and test 
  367. for minimum and maximum values,
  368. o  test for the presence of specific values,
  369. o  present data only if certain conditions are met,
  370. o  evaluate logical relationships between values,
  371. o  convert data from one type to another,
  372. o  merge text with other text,
  373. o  merge text with data field data, and
  374. o  perform numerous other useful, data-related activities.
  375.  
  376. The data can be placed wherever you want it on the report, highlighted 
  377. with special fonts and font sizes. With Crystal Reports, your reports can 
  378. be as simple or as complex as your needs demand.
  379.  
  380. 26.4.1 How Crystal Reports Prepares Reports
  381.  
  382. Crystal Reports prepares reports by reading data in the database files 
  383. you have selected and making that data available for use in your report.
  384.  
  385. o  If you wish to use data in a single data file, you simply choose that 
  386. file when you create the report.
  387.  
  388. o  If you wish to use data in multiple data files, you need to select the 
  389. files and also to indicate the field or fields in each file that Crystal 
  390. Reports is to use to match data. 
  391.  
  392. NOTE:  Crystal Reports does not write data to your original data files. 
  393. Your original files remain unchanged using Crystal Reports, no matter how 
  394. much you might manipulate the data you select.
  395.  
  396. 26.4.2 Databases that Work with Crystal Reports
  397.  
  398. Crystal Reports can build reports using the standard data files generated 
  399. by dBASE for Windows and Paradox for Windows as well as with DOS versions 
  400. of dBASE and Paradox.  
  401.  
  402.  
  403. 26.5 The Crystal Reports Window
  404.  
  405. The Crystal Reports window is simple and easy to understand:
  406. o  the Title Bar appears at the top of the window, 
  407. o  the Menu Bar appears just below the Title Bar, and
  408. o  the Button Bar appears just below the Menu Bar.
  409.  
  410. 26.5.1 Title Bar
  411.  
  412. The Title Bar displays the name of the program running in the window, 
  413. Crystal Reports. You can use the title bar to activate the window 
  414. (if the window is buried in a cascade of windows) or to move the window 
  415. (by depressing the left mouse button with the pointer on the title bar 
  416. and then, while the button is still depressed, dragging the window to a new 
  417. location), or to maximize the window (by double clicking on the title bar).
  418.  
  419. 26.5.2 The Menu Bar
  420.  
  421. The Menu Bar is Crystal Reports' command center. Each option on the menu 
  422. bar calls up a drop down menu of commands that you can use to create, 
  423. modify, print, and save your reports.
  424.  
  425. Each menu is listed in the table below:
  426.  
  427. File    The File menu includes commands you can use to open, close, and 
  428.     save files, to save files under a different file name, print the 
  429.     file to a printer, and create new report files. It also includes 
  430.     a command you can use to exit Crystal Reports. Additionally it 
  431.     contains a command that allows you to configure Crystal Reports 
  432.     to your specifications.
  433.  
  434. Edit    The Edit menu allows you to modify aspects of your report. The 
  435.     menu includes commands you can use to edit formulas, to edit and 
  436.     delete group sections, and to change summary operations. It also 
  437.     contains commands for cutting, copying, and pasting text, clearing 
  438.     (deleting) report elements, toggling the display of field names on 
  439.     and off, and changing your report title.
  440.  
  441. Insert  The Insert menu is the central menu you use for creating reports. 
  442.     The menu includes commands you can use to insert database fields, 
  443.     text fields, and formula fields; subtotals, grand totals, 
  444.     summaries (counts, averages, etc.), and group sections; print date, 
  445.     page number, record number and group number fields; and graphics, 
  446.     lines, and boxes.
  447.  
  448. Format  The Format menu includes commands for changing the look of the 
  449.     elements in your report. It includes commands for changing fonts, 
  450.     and formatting fields, report sections, graphics, lines, and boxes. 
  451.     The menu also provides commands for adding field borders as well as 
  452.     background color and drop shadows for your fields.
  453.  
  454. Data-   The Database menu is used to select and delete databases for use 
  455. base    with your reports, to change the alias you use to identify the 
  456.     database, and to link and unlink databases. It also has a command, 
  457.     File Location, for directing Crystal Reports to look for database 
  458.     files in new locations. Two verify commands can be used to adapt 
  459.     your reports to minor changes in database structure. 
  460.  
  461. Print   The Print menu includes commands that let you print your report to a 
  462.     print window, to a disk file, or to a printer, print the report 
  463.     definition (a report describing your report), select the records 
  464.     or groups to be included in your report, select the order in which 
  465.     report data is to be sorted (by record or by group), and select a 
  466.     printer if you want the report to print on something other than the 
  467.     default printer.
  468.  
  469. Window  The Window menu includes commands that let you rearrange icons and 
  470.     windows. It also lists the report windows that are open and includes 
  471.     a command that lets you close all report windows at once, if desired.
  472.  
  473. Help    The Help menu includes a command that takes you to Crystal Reports' 
  474.     main help index, a command that will give you information about the 
  475.     Crystal Reports version you are using, and other help-related topics.
  476.  
  477.  
  478. 26.5.3 The Button Bar
  479.  
  480. Crystal Reports groups several commonly-used commands on a Button Bar that 
  481. remains on screen at all times (unless you choose to turn it off).
  482.  
  483. Each command is represented by an individual button, and each button 
  484. displays a graphic that visually describes the command. You activate 
  485. Button Bar commands by clicking the appropriate button one time with the 
  486. left mouse button. The Button Bar eliminates some of the steps needed to 
  487. activate the included commands, and it can thus greatly speed your 
  488. work in creating reports. 
  489.  
  490. 26.5.4 The Status Bar
  491.  
  492. The status bar at the bottom of the report window displays valuable 
  493. information to help you use Crystal Reports more efficiently:
  494.  
  495.  
  496. o  Button bar functions:  When the cursor is over a Button Bar button, 
  497. the Status Bar displays a short description of the button's function.
  498.  
  499. o  Menu command descriptions:  When you highlight a menu command, the 
  500. Status Bar displays a short description of the command. To highlight a 
  501. menu command, click the menu name and move to the command using the Down 
  502. Arrow key.
  503.  
  504. o  Current selections:  When you select or place a graphic, field, text 
  505. field, graphic line or box, special field, or formula, the status bar 
  506. displays the name of the item selected. It displays:
  507.  
  508.     -  the file name for a graphic, 
  509.     -  the alias and field name for a field, 
  510.     -  the text in a text field, 
  511.     -  the words Line for a line and Box for a box,
  512.     -  the field type for special fields (PrintDate, RecordNumber, etc.)
  513.     -  the formula name for a formula.
  514.     
  515. o  Graphic Coordinates:  When you select or create a bit-mapped graphic, 
  516. a graphic box, or a graphic line, the program displays the coordinates 
  517. for the left, right, top, and bottom sides of the graphic element.
  518.  
  519.  
  520. 26.6 Right Mouse-Button Capabilities
  521.  
  522. When you are working in the Report Editor, you can speed up your work 
  523. considerably using Crystal Reports' right mouse button capabilities. When 
  524. the cursor is positioned on a report element (a field, a group field, a 
  525. formula, etc.) and you click the right mouse button, Crystal Reports 
  526. displays a pop-up menu right next to the element. Unlike Crystal Reports' 
  527. standard menus that group commands by function (editing, inserting, etc.), 
  528. these pop-up menus are element-specific: that is, they contain only those 
  529. commands from Crystal Reports' primary menus that are available for 
  530. use with the selected element. 
  531.  
  532. The pop-up menus are valuable because:
  533.  
  534. o  they display the name and source (alias) of the element at the top of 
  535. the menu so you can identify the elements on your report with a single 
  536. mouse click,
  537.  
  538. o  they appear right next to the selected element making them quicker and 
  539. easier to access than Crystal Reports' main menus,
  540.  
  541. o  they contain only the commands you need; you don't need to search for 
  542. commands on a more comprehensive menu,
  543.  
  544. o  they make it easier to learn Crystal Reports because: 
  545.  
  546.     - they eliminate the need to remember where to find a command, and
  547.     - they make it easier to pick the right command since you're dealing 
  548.     with only a compact list of, and
  549.  
  550. o  they spotlight the things you can do with an element making it an 
  551. easier system to use when you are under pressure or distracted.
  552.  
  553. Use the following procedure to use the right mouse button menus:
  554.  
  555. 1.  Position the cursor on the element of interest. 
  556.  
  557. 2.  Click the right mouse button. 
  558.  
  559.     The pop-up menu appears.
  560.  
  561. 3.  Select the command of interest from the pop-up menu. 
  562.  
  563.     These options work exactly like the corresponding options that appear 
  564.     on Crystal Reports' primary menus.
  565.  
  566. For information on using any of these menu options, see the corresponding 
  567. option in Crystal Reports Help.
  568.  
  569. NOTE:  If you have swapped left/right mouse buttons via the Control Panel, 
  570. the left mouse button will activate the pop-up menus.
  571.  
  572.  
  573. 26.7 Crystal Reports Report Windows
  574.  
  575. When a Crystal Reports report appears, it appears in a report window. A 
  576. report window has a title bar, minimize and maximize buttons, and a 
  577. control menu box like the Crystal Reports window.
  578.  
  579. Unlike the Crystal Reports window, the report window does not have its own 
  580. menu. Instead, the commands from the Crystal Reports menu remain visible and 
  581. are active for the document window.
  582.  
  583. Also unlike the Crystal Reports window, the document window has scroll 
  584. bars at the bottom and along the right hand edge. Usinh these scroll bars  
  585. you can reveal parts of the document that aren't immediately showing in the 
  586. window.
  587.  
  588.  
  589. 26.8 Getting Help with Crystal Reports
  590.  
  591. Crystal Reports offers a comprehensive help system to support you during 
  592. every step of the report development process.
  593.  
  594. 26.8.1 Context Sensitive Help
  595.  
  596. Context sensitive help gives you immediate help with a screen element of 
  597. interest (menu command, dialog box, etc.). The program takes you directly 
  598. to the help information you seek without the need to traverse the indexing 
  599. system.
  600.  
  601. NOTE:  To get help on a specific menu command, click the menu name and 
  602. then use the Down Arrow key to highlight the command of interest. Once the 
  603. command is highlighted, press F1.
  604.  
  605. 26.8.2 Indexed Help
  606.  
  607. Indexed help takes you to the help indexing system, a hierarchy of indexes 
  608. which is designed to help you target your topic of interest. Using the 
  609. indexing system, you can select a broad topic of interest from the first 
  610. index and then narrow your selection using the next index that appears, 
  611. then the next. etc. 
  612.  
  613.  
  614. 27.0 Using Crystal Reports
  615.  
  616. This chapter provides a structured approach to preparing reports with Crystal 
  617. Reports.
  618.  
  619. 27.1 Using Crystal Reports
  620.  
  621. The approach of this chapter in preparing reports with Crystal Reports 
  622. includes the following elements:
  623.  
  624. o  deciding on the content of your report,
  625. o  developing a prototype on paper,
  626. o  setting up the prototype using Crystal Reports,
  627. o  manipulating the data with formulas and functions,
  628. o  grouping, summarizing, and sorting your data,
  629. o  editing and formatting the data,
  630. o  specifying the records/groups to be included in the report, and
  631. o  printing the finished report.
  632.  
  633. This is not a hands-on chapter, but an important introduction that can 
  634. make your report creation work more efficient and more satisfying. The 
  635. chapter has been designed to provide you with a conceptual understanding 
  636. of Crystal Reports as well as a brief introduction to Crystal Reports' 
  637. powerful features. 
  638.  
  639.  
  640. 27.2 Deciding on the Content of Your Report
  641.  
  642. Before you do anything else, you should outline the information you want 
  643. your report to provide. Use the following list of questions as a guide in 
  644. making that outline:
  645.  
  646. o  What is the overall purpose of the report?
  647. o  Who is going to read the report?
  648. o  What is the report title going to be?
  649. o  What information do you need besides the title to identify the report?
  650.     - Where is that information to come from?
  651.     - If the information exists in a database, what types of fields 
  652.     is the data stored in: number, text, etc.?
  653. o  What identifying information do you want to appear at the bottom of 
  654. each page?
  655.     - Where is that information to come from?
  656.     - If the information exists in a database, what types of fields 
  657.     is the data stored in: number, text, etc.?
  658. o  What specific data do you want to appear in the body of the report?
  659.     - Where is that data to come from?
  660.     - Does that data exist in data fields or does it need to be 
  661.     calculated from data field values?
  662.     - What kind of fields is the data stored in: number, text, etc.?
  663.     - Do you want to show totals?
  664.     - What kind?
  665.     - What do you want to total?
  666. o  What information, if any, do you want flagged on the report?
  667.     - How do you want it flagged?
  668. o  What information do you want highlighted in some way so that it really 
  669. stands out?
  670. o  Do you want the report to be based on all records in the database or 
  671. only on specified records?
  672.  
  673. 27.2.1 Purpose
  674.  
  675. What is the overall purpose of the report?
  676.  
  677. Reports are management tools. Their purpose is to help individuals quickly 
  678. grasp the essential elements and relationships found in raw data so they 
  679. can make effective decisions. For a report to be effective, it has to 
  680. present the right data in a logical way. If it presents the wrong data or 
  681. if it presents the right data in a haphazard manner, the report may slow 
  682. the decision making process or even encourage incorrect decisions.
  683.  
  684. A good starting place in the development of a report is to write out the 
  685. purpose of the report in a sentence or two. The purpose statement helps you 
  686. focus on your primary needs, and it gives your report both a starting point 
  687. and a goal. 
  688.  
  689. Here are some examples of purpose statements:
  690.  
  691. o  The purpose of this report is to show monthly and year-to-date sales 
  692. by sales rep, compare this year's numbers to last year, and flag reps who 
  693. are seriously deficient.
  694.  
  695. o  The purpose of this report is to show sales activity for each item in 
  696. inventory, and to suggest reorder quantities based on that activity.
  697.  
  698. o  The purpose of this report is to calculate bowling averages and 
  699. handicaps for each member of the bowling league.
  700.  
  701. Clarifying the purpose of the report before you start is a critical step in 
  702. the overall process. A report without a clear purpose is like a meeting 
  703. without a clear agenda; it rambles and accomplishes little.
  704.  
  705. 27.2.2 Readers
  706.  
  707. Who is going to read the report?
  708.  
  709. A single report is often used by many individuals. A detailed, company-wide 
  710. sales report, for example, may be used by sales reps, the regional sales 
  711. manager, the national sales manager, and the Chief Operating Officer (COO). 
  712.  
  713. Each of these individuals will be interested in different aspects of the 
  714. report.
  715.  
  716. o  A sales rep will use the report to evaluate his/her individual sales 
  717. performance and to compare that performance to that of other reps in the 
  718. region.
  719.  
  720. o  The regional sales manager will use the report to evaluate the reps in 
  721. his/her region and to compare the region's performance to that of other 
  722. regions. 
  723.  
  724. o  The national sales manager will use the report to evaluate the 
  725. performance of his/her regional managers and to compare overall sales to the 
  726. current sales forecasts.
  727.  
  728. o  The COO will use the report to evaluate the performance of the Vice 
  729. President of Marketing and the sales department as a whole, and to project 
  730. such things as manufacturing needs, warehouse locations, etc.
  731.  
  732. Since each of the users of the report has different interests, it is 
  733. important to plan the report so it includes the information each of the 
  734. users is looking for.
  735.  
  736. 27.2.3 Title
  737.  
  738. What is the report title going to be?
  739.  
  740. Write out a working title for your report. You may decide to change it 
  741. later, but at least you will have a title to use when creating your 
  742. prototype report.
  743.  
  744. 27.2.4 Other Header Information 
  745.  
  746. What information do you need besides the title to identify the report?
  747.  
  748. Are you going to include identifying information in addition to your 
  749. report title? You may wish to include the current date, information on 
  750. who prepared the report, a block of text to describe the purpose of the 
  751. report, the range of data covered, etc. If you are going to include such 
  752. information, write it down so you can use it in preparing your prototype.
  753.  
  754. 27.2.5 Header Information Sources
  755.  
  756. Where is that information to come from?
  757.  
  758. The information can come from a variety of sources, depending on the kind 
  759. of information you plan to use. For example, the current date can be 
  760. inserted using the Crystal Reports Insert|Print Date Field command. 
  761. Information on who prepared the report might be drawn from individual data 
  762. fields in the database(s) used. (If it is to be drawn from a database, what 
  763. database? Or, what combination of databases?) A block of text can be 
  764. created and entered on the face of the report itself. As you begin to think 
  765. of where the information is to come from, you begin formally structuring 
  766. the report.
  767.  
  768. 27.2.6 Data Types in the Header
  769.  
  770. If the information exists in a database, what types of fields contain the 
  771. data: number, text, etc.?
  772.  
  773. Crystal Reports uses different rules for working with different types of 
  774. data. You will find it helpful later if you note the data type of each 
  775. piece of data you plan to draw from a database.
  776.  
  777. 27.2.7 Footer Information
  778.  
  779. What identifying information do you want to appear at the bottom of each 
  780. page (page number, report name, author's name, "Confidential," etc.)?
  781.  
  782. 27.2.8 Footer Data Sources
  783.  
  784. Where is that information to come from?
  785.  
  786. 27.2.9 Data Types in the Footer
  787.  
  788. If the information exists in a database, what types of fields is the data 
  789. stored in: number, text, etc.?
  790.  
  791. 27.2.10 Report Body Data
  792.  
  793. What specific data do you want to appear in the body of the report?
  794.  
  795. When you think of a report, it is probably the body of the report that you 
  796. think of. The body should contain all the data that you need to fulfill the 
  797. statement of purpose you wrote for the report. It should also contain all of 
  798. the data needed by the various users that you have identified. You 
  799. might find it helpful to list first the basic data that is required to 
  800. fulfill the purpose statement, and then list the more specific kinds of data 
  801. needed by the various users.
  802.  
  803. 27.2.11 Body Data Sources
  804.  
  805. Where is that data to come from?
  806.  
  807. This step requires you to look at the available databases. Crystal Reports 
  808. allows you to combine data from different databases to create your reports, 
  809. so you have a great deal of flexibility in your work.
  810.  
  811. o  Much of the data in a typical report will be taken directly from data 
  812. fields. Which data fields will you be using and where are they located?
  813.  
  814. o  Other data will be calculated based on data fields. Which data fields 
  815. will be used in the calculations?
  816.  
  817. o  Still other data will be input directly into the report (headings, text 
  818. blocks, etc.). Which data will you enter directly on the report, without 
  819. drawing it from data fields?
  820.  
  821. 27.2.12 Existing or Calculated?
  822.  
  823. Does that data exist in data fields or does it need to be calculated from 
  824. data field values?
  825.  
  826. Some report information can be drawn directly from data fields (sales 
  827. information, for example); other information will have to be calculated 
  828. based on data field values (sales commission, for example, based on the 
  829. relationship of sales to quota). In your planning, it can be helpful to 
  830. segregate or flag data that needs to be calculated from that which can 
  831. be used directly.
  832.  
  833. 27.2.13 Data Types in the Body
  834.  
  835. What kinds of fields contain the data: number, text, etc.?
  836.  
  837. While it is important to understand data types for all data you will be 
  838. using, it is of critical importance that you know the data type for data 
  839. fields that will be used in calculations. Functions and operators work with 
  840. specific kinds of data, so it's important to know the data type to 
  841. know which functions and operators you can use in your calculations.
  842.  
  843. 27.2.14 Groups
  844.  
  845. Do you want your data organized into groups? How do you want it grouped? By 
  846. customer? By date? 
  847.  
  848. 27.2.15 Group Values
  849.  
  850. Do you want to show a subtotal at the end of each group? A count? An 
  851. average? Crystal Reports allows you to specify several kinds of group values.
  852.  
  853. 27.2.16 Group Value Positions
  854.  
  855. Where do you want the group values to appear. With the group data? With the 
  856. group data but on a page separate from other groups? Only at the bottom of 
  857. the page?  Crystal Reports gives you all of these options.
  858.  
  859. 27.2.17 Grand Totals, Grand Total Averages, etc.
  860.  
  861. Do you want to total (or average, count, or determine the maximum or 
  862. minimum value included in) all the values in any column on your report?
  863.  
  864. Crystal Reports allows you to do this and place the grand total (or the 
  865. grand total average, grand total count, etc.) at the bottom of the selected 
  866. column.
  867.  
  868. 27.2.18 Flags
  869.  
  870. What information, if any, do you want flagged on the report?
  871.  
  872. You may want to call attention to some data by flagging it on your report. 
  873. For example, non-moving inventory items are often flagged on inventory 
  874. reports so they can be given special attention. If you want any information 
  875. flagged, identify the information and the parameters for flagging. 
  876.  
  877. Using the inventory report example, you might want to flag each item that 
  878. has shown no activity during the last month, during the last three months, 
  879. or during some defined period.
  880.  
  881. 27.2.19 Flag Options
  882.  
  883. How do you want it flagged?
  884.  
  885. You may want to flag items with an asterisk or some other symbol, or you 
  886. may want a word to appear as a flag. In any case, you should write out 
  887. flagging instructions so they are handy.
  888.  
  889. 27.2.20 Highlights
  890.  
  891. What information do you want highlighted in some way so that it really 
  892. stands out?
  893.  
  894. Crystal Reports gives you the opportunity to underline report elements, or 
  895. to change the fonts or font size used for specific report items. All of 
  896. these formatting tools can be used to highlight key data on a report. If 
  897. you have data that you want highlighted, you should write down highlighting 
  898. instructions so they are handy too. 
  899.  
  900. 27.2.21 Record or Group Selection
  901.  
  902. Do you want the report to be based on all records or groups in the database 
  903. or only on specified records or groups?
  904.  
  905. Crystal Reports gives you the opportunity to base a report on all records in 
  906. a given database, or on a limited set of records from the database. Using 
  907. Crystal Reports you can select records based on simple date ranges or 
  908. comparisons, or you can create complex formulas to identify the records 
  909. to be included. Take a few minutes to determine the records needed for your 
  910. report and list the criteria to be used for selecting those records.
  911.  
  912. 27.2.22 Sorting
  913.  
  914. Do you want your data sorted based on record or group values?
  915. Crystal Reports gives you both alternatives.
  916.  
  917.  
  918. 27.3 Developing a Prototype on Paper
  919.  
  920. Graphic designers generally begin their work on a magazine cover, 
  921. brochure, or display advertisement with a rough pencil sketch. They often 
  922. use boxes, circles, or other symbols to represent the graphic elements they 
  923. intend to include in the final product, and they often use lines or 
  924. scribbles to represent text. Doing the rough design on paper, in pencil, 
  925. helps them create a "look" for each page. It helps them find a balanced 
  926. way of positioning the various elements before they begin working with 
  927. sophisticated graphics tools. We think you will find a similar exercise 
  928. helpful in designing your Crystal Reports reports.
  929.  
  930. While a paper prototype is useful regardless of your expertise with Crystal 
  931. Reports, it is particularly valuable when you are first learning to use the 
  932. Crystal Reports program. With the paper prototype at hand, you can put your 
  933. full effort into learning and using the Crystal Reports commands instead of 
  934. trying to design and learn at the same time.
  935.  
  936. Use the following procedure to design a paper prototype with Crystal Reports:
  937.  
  938. o  Get paper of the size you'll be using for your finished report.
  939. o  Position your title and other descriptive header information, using 
  940. boxes or lines to represent report elements.
  941. o  Position your footer information.
  942. o  Review the page for balance.
  943. o  Look at the information you intend to include in the body of your report.
  944.     - Count the number of fields you will be using and estimate the 
  945.     appropriate spacing between fields.
  946.     - Use rectangles to pencil in the fields using your estimated spacing.
  947.     - Change the spacing if necessary.
  948.     - Decide on a logical sequence for presenting the report data.
  949.     - Label the fields to indicate that sequence.
  950. o  Use small boxes to indicate group values and totals.
  951. o  Place some random flags where you want the flags to appear.
  952. o  Darken any elements you want highlighted so they stand out from the 
  953. rest of your prototype.
  954. o  Review your finished product for look and balance, and make changes as 
  955. needed.
  956.  
  957.  
  958. 27.4 Setting Up the Prototype Using Crystal Reports
  959.  
  960. Once you have completed your paper prototype, it is a straightforward 
  961. process to recreate that prototype in the computer, using Crystal Reports. 
  962. Before you do, it is important to understand how Crystal Reports' report 
  963. editing process works.
  964.  
  965. NOTE:  This section assumes that you are new to Crystal Reports and that 
  966. you plan to build a simple report using data from a single database. No 
  967. advanced topics are covered in this section.
  968.  
  969. When you want to begin a new report, Crystal Reports displays the Choose 
  970. Database File dialog box.  You use this dialog box to select the database 
  971. file(s) that contain the data you want to use in your report. You will 
  972. first select the directory and, once in the directory, you can select the 
  973. database file you identified earlier in Deciding on the Content of Your 
  974. Report.
  975.  
  976.  
  977. 27.5 The Report Editor
  978.  
  979. Once you select your database, Crystal Reports displays the Report Editor 
  980. screen. You use this screen to insert and format data and to watch your 
  981. report take shape.
  982.  
  983. When you open a new report, Crystal Reports automatically creates three 
  984. sections in the Report Editor:
  985.  
  986. o  A Page header section - this section is generally used for the report 
  987. title, field headings, and other information that you want to appear at the 
  988. top of each page.
  989. o  A Details section - this section is the body of the report. The bulk of 
  990. your report data will generally appear in this section.
  991. o  A Page footer section - this section usually contains the page number 
  992. and any other information that you want to appear on the bottom of each page.
  993.  
  994. The name of each section appears in the gray area to the left of the Report 
  995. Editor edit box.
  996.  
  997. o  You build your report by inserting data fields, formulas, and other 
  998. report elements (record counts, record numbers, etc.) in the Details 
  999. section of the editor. You use the Insert menu, in most cases, to select 
  1000. or create the elements you want to insert on the report. The Report Editor 
  1001. uses rectangular element markers to indicate the size, position, and data 
  1002. type of the report elements you have inserted.
  1003.  
  1004. o  You add subtotals (and other group values) by selecting a field to 
  1005. subtotal and then telling Crystal Reports the conditions that are to 
  1006. generate a new subtotal or group value (change of customer number, change 
  1007. of sales rep, etc.). Crystal Reports creates group value sections as 
  1008. needed and places the group value in the section. Again, Crystal Reports 
  1009. uses rectangular field boxes to represent the group values.
  1010.  
  1011. o  You insert grand totals in the Grand Total section. This section appears 
  1012. when you select the field to total and then select Insert|Grand Total. 
  1013. Crystal Reports uses a rectangular field box, this time to identify the 
  1014. field in the Grand Total section of the Report Editor.
  1015.  
  1016. o  You can add freeform text anywhere on the report by positioning the 
  1017. text cursor in the section in which you want the text to appear, typing in 
  1018. the text, and then using the Tab key to move it into position. You can also 
  1019. type freeform text in a text field; this allows you to avail yourself of 
  1020. additional formatting options (alignment, hide options, etc.).
  1021.  
  1022. 27.5.1 Auto-Scrolling Capabilities
  1023.  
  1024. The Report Editor has auto-scrolling capabilities. That is, whenever the 
  1025. cursor hits one of the edges of the Report Editor when you are placing, 
  1026. resizing, or moving a field or drawing a graphic line or box, the Editor 
  1027. automatically scrolls to reveal more workspace (if more is available).
  1028.  
  1029. 27.5.2 Resizing Sections
  1030.  
  1031. The Report Editor first appears with default section sizes. You can expand 
  1032. or reduce report sections by dragging the lines that separate the sections. 
  1033. When you position the I-beam cursor over one of those lines, the cursor 
  1034. changes to a double-arrow resizing cursor. Once that cursor appears, 
  1035. you can resize as needed. Alternately, to expand a report section, you can 
  1036. click the section of interest and press Enter as many times as needed. Once 
  1037. you've expanded a section, you can reduce it by deleting unneeded lines with 
  1038. the Backspace key.
  1039.  
  1040. 27.5.3 A Word about Databases, Records and Fields
  1041.  
  1042. Before we go any further, a discussion of databases, records, and fields 
  1043. is in order. A record is the basic building block of a database. Each record 
  1044. contains data about a single entity (a customer, an order, etc.), and each 
  1045. database contains at least one record. The data in each record is stored in 
  1046. fields (holding spaces). Each field holds one piece of data known as a value. 
  1047. The database from which you will create a report is a collection of related 
  1048. records. A customer database, for example, is a collection of records that 
  1049. each contain data on a single customer.
  1050.  
  1051. 27.5.4 Records and Fields in Row/Column Reports
  1052.  
  1053. Think of the data in a database as being stored in horizontal rows and 
  1054. vertical columns.
  1055.  
  1056. CustNumber              Fname           Lname
  1057. 01034456                Bill            Brown
  1058. 01034457                Jane            Doe
  1059. 01034458                Bob             Jackson
  1060. 01034459                Mary            Jones
  1061.  
  1062. The table above shows field values for four records from such a database 
  1063. (in this case a customer database). 
  1064.  
  1065. o  Each row represents one record. All of the data in that row is about a 
  1066. single customer, but the data is broken into three distinct pieces: customer 
  1067. number, first name, and last name. Each of those pieces represents a 
  1068. value found in a field on that record, the CustNumber, Fname, and Lname 
  1069. fields respectively (as indicated by the column headings).
  1070.  
  1071. o  Each column represents one field. All the data in a given column 
  1072. represents the values that appear in that field on each of the records in 
  1073. the database.
  1074.  
  1075. The structure of a row/column report corresponds to the structure of a 
  1076. database with rows representing individual records and columns 
  1077. representing individual fields. 
  1078.  
  1079. 27.5.5 Records and Fields in Data Block Reports
  1080.  
  1081. Some reports don't follow the row/column format, however. Instead, some group 
  1082. related data in data blocks. A mailing list, for example, typically uses 
  1083. several rows for each record: a row for the company name, a second row for 
  1084. the street address, a third row for the city, state and ZIP code, etc. In 
  1085. such a report all the data for a given customer in the list appears 
  1086. in a block. Each block represents a single record even though the data in 
  1087. the block spans several rows. 
  1088.  
  1089. 27.5.6 Data Types
  1090.  
  1091. The data type of a field, (string, number, currency, date, Boolean, or memo) 
  1092. determines the type of information that can be stored in that field and 
  1093. which will print in the report column. 
  1094.  
  1095. Fields of each data type display on your screen like this:
  1096.  
  1097. XXXXXXX         String - for example, a company name, account description 
  1098.         or customer name.
  1099.  
  1100. $5,555,555.55   Currency (Paradox/Btrieve files only) - for example $500.00 
  1101.         or $50,000,000.00-.
  1102.  
  1103. 5,555,555.55    Number - for example 120 or 5555.
  1104.  
  1105. YYYY-MM-DD      Date - for example Oct 10 90.
  1106.  
  1107. YES/NO          Boolean (YES/NO) data fields - for example, the result of a 
  1108.         formula which compares a customer's credit limit to see if 
  1109.         it is greater than $5000 and prints YES if the credit limit 
  1110.         is more than that amount; NO if it is less than that amount.
  1111.  
  1112. XXXXXXX         Memo - a paragraph describing a piece of property, 
  1113.         comments regarding a job applicant, a summary of a movie 
  1114.         plot, etc.
  1115.  
  1116. 27.5.7 Formatting, and Record and Group Selection
  1117.  
  1118. While formatting, and record and group selection will be covered in depth 
  1119. later, there are a few things about those subjects that are worthwhile to 
  1120. cover here:
  1121.  
  1122. o  Currency, date, and Boolean fields are shown above in the default format. 
  1123. This format is used for both the element markers (in the report editor) and 
  1124. for the report elements themselves (in the report). If you want your data 
  1125. to appear in a different format on your report, you can make the desired 
  1126. changes using the Format|Field command.
  1127.  
  1128. NOTE:  The characters in the element markers change to reflect font changes 
  1129. and many formatting changes (alignment, etc.).
  1130.  
  1131. o  The width and position of a field (when you place it in the Report Editor) 
  1132. determines the initial spacing between fields and the order in which the 
  1133. fields will print across the report page.
  1134.  
  1135. o  When you insert a data field in your report, Crystal Reports assumes that 
  1136. you want to pull data from all the data records in the selected database. 
  1137. To limit the records (or groups of records) used in your report, you need 
  1138. to tell Crystal Reports how to identify the records or groups of records 
  1139. you want to include. Using Edit Record Selection Formula or Edit Group 
  1140. Selection Formula on the Print menu, you can build the selection formula 
  1141. that fits your needs.
  1142.  
  1143.  
  1144. 27.6 Building Your Prototype
  1145.  
  1146. To build your report you will follow these steps:
  1147.  
  1148. o  Select the database(s) you wish to use in your prototype report.
  1149. o  Enter and position the data fields, text, and titles you want included 
  1150. in the header, footer, and body of your report.
  1151. o  Print your report to the Print Window and review your work.
  1152. o  Make whatever changes are called for.
  1153. o  Insert your totals, subtotals and other group fields.
  1154. o  Enter and position any formula fields that will calculate or 
  1155. manipulate data or create flags.
  1156. o  Print your report to the Print Window and review your work.
  1157. o  Format the report elements that you want to stand out in some way from 
  1158. the others. 
  1159.  
  1160. 27.6.1 Selecting the Database(s)
  1161.  
  1162. You use the File|New Report command to begin a report from scratch. That 
  1163. command leads you to a dialog box from which you can select the first 
  1164. database you wish to use. To select additional databases, you use the 
  1165. Database|Add File to Report command.
  1166.  
  1167. 27.6.2 Entering and Positioning Data Fields
  1168.  
  1169. Enter and position data fields using the Insert Database Field dialog 
  1170. box that lists available fields in the selected database. Make your 
  1171. selections from the list, and then place the field in your report using 
  1172. the rectangular field placement cursor that appears.
  1173.  
  1174. 27.6.3 Adding Text
  1175.  
  1176. You can add text to your report by typing it at the text cursor and then 
  1177. moving it into place. Move the I-beam cursor to the line on which you 
  1178. wish to enter text and click the left mouse button to set the text cursor 
  1179. at the left edge of the Report Editor. Then, simply type in your 
  1180. text, move the I-beam cursor in front of it, and push it into position using 
  1181. the Tab key or Space Bar. You can also add text by inserting text fields and 
  1182. positioning them as you would any other field.
  1183.  
  1184. 27.6.4 Entering Field Titles
  1185.  
  1186. By default, Crystal Reports automatically inserts a field title whenever 
  1187. you insert a new field or formula field. The title is a text field that can 
  1188. be edited. The left edge of the title field comes aligned with the left edge 
  1189. of the field it identifies. To toggle this feature off you use the 
  1190. File|Options command.
  1191.  
  1192. 27.6.5 Printing and Reviewing
  1193.  
  1194. You can print and review your work in progress at any time using the 
  1195. Print|Print To Window command. When you select this command, Crystal 
  1196. Reports prints your report to the print preview window. 
  1197.  
  1198. 27.6.6 Making Changes
  1199.  
  1200. Move a database field drag it to a new position with the mouse, or by 
  1201. selecting it and using the Arrow keys. You can move a field within 
  1202. its originating section or to other sections of your report if you wish. 
  1203. To delete a field select it and then press the Delete key or select 
  1204. Edit|Clear.
  1205.  
  1206. NOTE:  To select multiple fields at one time, press the Shift key and, 
  1207. while keeping it depressed, click the various fields you want to select. 
  1208. Handles will appear on each field selected. When finished, you can 
  1209. move or delete the selected fields as a group.
  1210.  
  1211. 27.6.7 Placing Totals, Subtotals, and Other Group Values
  1212.  
  1213. To place grand totals select the numeric or dollar field you want to total, 
  1214. and then select Insert|Grand Total from the Menu Bar.
  1215.  
  1216. Select group values (subtotals, group averages, group counts, etc.) by 
  1217. first selecting the field you want grouped. Then select the kind of 
  1218. group value you want, using the Insert|Subtotal or Insert|Summary commands. 
  1219. Select the kind of group value you want (if you selected Insert|Summary). 
  1220. Then select the field that the program uses to sort and group your data 
  1221. by and the sort direction.
  1222.  
  1223. 27.6.8 Moving Group Values
  1224.  
  1225. To move a subtotal or summary drag it to a new position with the mouse, or 
  1226. select it and move it with the Arrow keys. You can move subtotals and 
  1227. summaries only within their originating sections, or from the group footer 
  1228. section to the group header section for the subtotal or summary of interest.
  1229.  
  1230. 27.6.9 Entering Formulas
  1231.  
  1232. Enter formulas using the Insert|Formula command. This command calls up 
  1233. the Formula Editor. Using the Formula Editor, build your formula using 
  1234. fields, functions, and operators, and check your work using the built in 
  1235. formula checker.
  1236.  
  1237. 27.6.10 Formatting
  1238.  
  1239. You can change the font or point size using the Format|Font command. You 
  1240. can change the alignment and printing characteristics of field data using 
  1241. the Format|Field command, and you can change the conditions that trigger 
  1242. subtotals, add page breaks, suppress blank lines, hide selected sections, 
  1243. etc. using the Format|Section command. 
  1244.  
  1245. Once you have built a prototype report, you have a working model that you 
  1246. can customize to meet your specific needs.
  1247.  
  1248.  
  1249. 27.7 Manipulating the Data with Formulas and Functions
  1250.  
  1251. Crystal Reports uses formulas and functions to help you create reports more 
  1252. quickly and easily. It uses them also to allow you to do the kind of 
  1253. "number crunching" and data manipulations that are necessary for advanced 
  1254. reporting.
  1255.  
  1256. 27.7.1 Formulas
  1257.  
  1258. A formula is a set of instructions that may be used to calculate 
  1259. information you can't obtain directly from database data fields. 
  1260.  
  1261. For example:
  1262. o  A database record may have a Qty1 field and a Qty2 field but no field 
  1263. that sums both quantities. If you want the sum of these two fields to 
  1264. appear on your report, you need a formula that adds the value in one field 
  1265. to the value in the other. 
  1266.  
  1267. o  A database record for a sales rep may contain the field GrossSales and 
  1268. you want to use 120% of that gross as the sales quota for the following year. 
  1269. To accomplish this you need a formula that multiplies GrossSales by 120%.
  1270.  
  1271. o  A database record for a one product company may contain a field Revenue 
  1272. that expresses total dollar sales for the year. You're interested in 
  1273. determining the number of units sold based on an average price of 49.95 per 
  1274. unit. To accomplish this you need a formula that divides Revenue by 49.95.
  1275.  
  1276. All of these examples require simple formulas: {file.Qty1} + {file.Qty2}, 
  1277. 1.20 * {file.GrossSales}, and {file.Revenue}/49.95 respectively. These 
  1278. formulas all use Crystal Reports operators (+, * [multiply], / [divide]) 
  1279. and they're all easy to create and understand.
  1280.  
  1281. But not all of your information needs can be reduced to simple formulas; 
  1282. some needs require extensive calculations or manipulations. For example:
  1283.  
  1284. o  You want to determine your average monthly unit sales for the last year, 
  1285. rounded to the nearest unit.
  1286.  
  1287. o  You want to convert ounces of inventory to pounds and ounces, and have 
  1288. it appear in the format x pounds y ounces.
  1289.  
  1290. The formulas required to accomplish these activities require a fair amount 
  1291. of data manipulation: rounding, averaging, converting numbers to text, 
  1292. calculating remainders, etc. While some of the manipulations (averaging, 
  1293. calculating remainders) can be done using Crystal Reports operators alone, 
  1294. others can't be done without the use of functions. And even the ones that can 
  1295. be done without functions can be done more quickly and efficiently with them. 
  1296. (For additional information on formulas, see Crystal Reports Help.)
  1297.  
  1298. 27.7.2 Functions
  1299.  
  1300. A function is a preset procedure or subroutine used to evaluate, make 
  1301. calculations on, or transform data. For example:
  1302.  
  1303. o  the NumericText function evaluates the contents of a text field to see 
  1304. if it is a number, and
  1305.  
  1306. o  the UpperCase function transforms all lowercase characters in a string 
  1307. to uppercase.
  1308.  
  1309. When you specify a function, Crystal Reports performs the set of operations 
  1310. built into the function without requiring you to specify each operation 
  1311. separately. For example:
  1312.  
  1313. o  the Average function sums a list of values and divides the sum by the 
  1314. number of values in the list.
  1315.  
  1316. o  the DayOfWeek function extracts the day component of a date, determines 
  1317. the day of the week the date falls on, and converts the day of the week to 
  1318. a number (1-7) where Sunday is the first day of the week.
  1319.  
  1320. By performing multiple operations with a single command, these kinds of 
  1321. functions are a kind of shorthand that make it easier and less time 
  1322. consuming for you to create reports. 
  1323.  
  1324. But not all functions involve lengthy calculations; some simply allow you 
  1325. to do things that you couldn't do easily without them while others take the 
  1326. drudgery out of report creation. For example:
  1327.  
  1328. o  the ToNumber function converts a number that has been stored as text, 
  1329. to a number that can be used in calculations, and
  1330.  
  1331. o  TrimRight removes all the spaces to the right of a string of data 
  1332. stored left-justified in a database.
  1333.  
  1334. 27.7.3 How Functions are Used
  1335.  
  1336. Functions are used in formulas. In fact, a single function and its 
  1337. required argument(s) may include the entire formula. For example, Abs 
  1338. ({file.TestResult}) is a perfectly acceptable, stand-alone formula for 
  1339. calculating the absolute value of the field TestResult.
  1340.  
  1341.        
  1342. 27.7.4 Function Syntax
  1343.  
  1344. Each function comes with its own set of usage rules (syntax). These rules 
  1345. must be followed for the function to perform correctly. If they are not, 
  1346. Crystal Reports displays a Formula Compiler Error message.
  1347.  
  1348. As an example, the correct syntax for using the Average([array]) function is:
  1349.  
  1350.     Average ([array])
  1351.  
  1352.     << where array is an array of constants, field values or calculation 
  1353.     results, separated by commas.>>
  1354.  
  1355. Translated, this means that to use the Average([array]) function correctly, 
  1356. you should enter: 
  1357.  
  1358.     Average 
  1359.  
  1360. followed by a list of numeric values, separated by commas, with the list of 
  1361. values enclosed in brackets, and with the array enclosed in parentheses. 
  1362. Thus:
  1363.  
  1364.     Average ([1,2,3,4,5]) 
  1365.  
  1366. is an example of the correct way to use the Average([array]) function.
  1367.  
  1368. If you try to use the function:
  1369.  
  1370. o  without separating the values by commas,
  1371. o  without enclosing the values in brackets, 
  1372. o  without enclosing the array in parentheses, 
  1373. o  while including any unnecessary characters, or 
  1374. o  with values that are not numeric,
  1375.  
  1376. Crystal Reports won't accept the formula and will display a Compiler Error 
  1377. message identifying your error.
  1378.  
  1379. 27.7.5 Entering Formulas and Functions
  1380.  
  1381. Formulas and functions are entered via Crystal Reports' Formula Editor.
  1382.  
  1383. The Formula Editor is a dialog box that contains all the tools you need to 
  1384. create and check the correctness of formulas. Using the Editor, you:
  1385.  
  1386. o  assign a name to your formula, 
  1387. o  enter the formula, 
  1388. o  check it to make sure you have entered it correctly, and then 
  1389. o  accept it for use in your report. 
  1390.  
  1391. When you accept it, Crystal Reports places the formula in your report in the 
  1392. position you selected for it. Then, when you print the report, Crystal 
  1393. Reports prints the results of the formula instead of the formula itself.
  1394.  
  1395. 27.7.6 The Fields Box
  1396.  
  1397. You can enter fields into your formulas in two ways: via the Fields box, or 
  1398. manually.
  1399.  
  1400. o  To enter a field via the Fields scroll box, you move the I-beam cursor 
  1401. to the place you want to insert the field and click the left mouse button to 
  1402. set the text cursor at that point. Then you locate the field you wish 
  1403. to insert from the Fields scroll box list.
  1404.  
  1405.     - Fields already in use in the report are grouped at the top of the 
  1406.     list; other available fields follow. 
  1407.  
  1408.     - Formulas you have entered are listed next, their names preceded by 
  1409.     the @ sign.
  1410.  
  1411.     - All other fields available in the active databases are listed 
  1412.     last, grouped by database.
  1413.  
  1414. Select a field. Crystal Reports inserts the selected field (complete with 
  1415. the required syntax elements) at the text cursor.
  1416.  
  1417. NOTE:  You select an item from the Formula Editor scroll boxes (Fields, 
  1418. Functions, or Operators) by double clicking it, or by clicking it once to 
  1419. highlight it and then clicking the Select button at the bottom of the 
  1420. Editor to complete the selection process. 
  1421.  
  1422. o  To enter a field manually, you locate the text cursor in the appropriate 
  1423. position and type in the field name as you would any text. 
  1424.  
  1425. o  The correct syntax for a database field name is: 
  1426.  
  1427.     {file.fieldname}
  1428. If you: 
  1429.  
  1430.     - don't include the file name,
  1431.     - leave out the separating period, or 
  1432.     - fail to surround the expression in braces, 
  1433.  
  1434. Crystal Reports will generate a Formula Compiler Error message detailing 
  1435. your error.
  1436.  
  1437. o  The correct syntax for a formula field is:
  1438.  
  1439.     {@formulaname}
  1440.  
  1441. 27.7.7 Operators and Functions Boxes
  1442.  
  1443. You can also enter operators and functions into your formula in one of two 
  1444. ways: manually or via the Operators and Functions scroll boxes. 
  1445.  
  1446. o  To enter an operator or function manually, locate the text cursor in 
  1447. the appropriate position and type in the operator or function as you would 
  1448. any text. 
  1449.  
  1450. o  To enter an operator or function via the lists in the Functions and 
  1451. Operators scroll boxes, set the text cursor where you want the entry 
  1452. to appear in the formula. 
  1453.     - Then select the item of interest from the scroll box lists. 
  1454.     Crystal Reports inserts the selected item in your formula, complete 
  1455.     with any parentheses, brackets, or commas required.
  1456.  
  1457.     NOTE:  For an array of items, only the first comma is included. As 
  1458.     you enter additional items into an array, you will need to type in 
  1459.     commas to separate the items.
  1460.  
  1461. 27.7.8 Order of Precedence
  1462.  
  1463. When entering formulas that contain different kinds of operators, it is 
  1464. important to consider order of precedence, the order in which Crystal 
  1465. Reports performs the operations in your formula. 
  1466.  
  1467. You learned simple order of precedence in high school math: when performing 
  1468. calculations, do multiplication and division first, then addition and 
  1469. subtraction. Thus:
  1470.  
  1471.     5 + 10 X 3 = 35
  1472.  
  1473. The calculation 10 x 3 is performed first to get 30. 30 is then added to 
  1474. 5 to arrive at the final answer.
  1475.  
  1476. Now if your intention is to add 5 to 10 and then multiply the sum by 3, 
  1477. you have to modify the order of precedence with parentheses. You can do 
  1478. that thus:
  1479.  
  1480.     (5 + 10) x 3 = 45
  1481.  
  1482. It's clear that parentheses have a higher precedence than the add, 
  1483. subtract, multiply, and divide operators. They redirect the order of 
  1484. calculation.
  1485.  
  1486. You learned all of this in school and Crystal Reports follows the same 
  1487. rules of precedence. But Crystal Reports uses many additional operators, 
  1488. and it's important for you to understand the precedence Crystal Reports 
  1489. assigns to each so you can write your formulas to perform as expected.
  1490.  
  1491. o  In the following list, Crystal Reports performs the top level operations 
  1492. first, then the second level, then the third, and so forth.
  1493.  
  1494. o  When it encounters two or more operations that are on the same level, 
  1495. it performs them left to right. 
  1496.  
  1497. Level 1         Parentheses, Array, IfThenElse
  1498. Level 2         Call, Subscript
  1499. Level 3         Identity, Negate, Dollar, Not
  1500. Level 4         Multiply, Divide, Percent
  1501. Level 5         Add, Subtract
  1502. Level 6         To
  1503. Level 7         Less than, Greater than, Greater than or equal, Less than 
  1504.         or equal, In
  1505. Level 8         Equal, Not equal
  1506. Level 9         And
  1507. Level 10        Or
  1508.  
  1509. 27.7.9 Using Dates in Formulas
  1510.  
  1511. Crystal Reports includes many useful functions for including dates and 
  1512. date ranges in formulas; you will learn more about those functions in 
  1513. Crystal Reports Help. At this point, however, it's useful to know how to 
  1514. enter any date into a formula. 
  1515.  
  1516. You enter a date simply by entering the Date function (manually or via the 
  1517. Function button) and then providing the date of interest in the parentheses 
  1518. that follow in the form YYYY,MM,DD (1992,01,01 = January 1, 1992). 
  1519.  
  1520. 27.7.10 The Formula Checker
  1521.  
  1522. The Formula Editor also contains a formula checker which checks the syntax 
  1523. of your formula. If the syntax is incorrect, the formula checker points out 
  1524. the location of the problem and tells you what the problem is. You activate 
  1525. the formula checker by selecting the Check button. Crystal Reports also 
  1526. checks the formula automatically when you choose Accept. When debugging 
  1527. formulas, especially if you have entered them manually, look carefully for:
  1528.  
  1529. o  missing quotation marks around text strings, 
  1530. o  missing database name accompanying field names,
  1531. o  missing braces around database name/field name combinations,
  1532. o  missing closing parentheses to match opening parentheses, 
  1533. o  case differences (the Formula Checker is case sensitive),
  1534. o  if-then-else formulas that use different data types for the then and 
  1535. else actions, and
  1536. o  using X instead of * for multiplication.
  1537.  
  1538. The Formula Editor is easy to use and can be called up by selecting Formula 
  1539. from the Insert menu.
  1540.  
  1541. 27.7.11 Developing Complex Calculations with Formulas
  1542.  
  1543. Crystal Reports allows you to combine fields, functions, and operators to 
  1544. create complex calculations and manipulations of data. For example, to test 
  1545. the drawing power of two different offers, you can use a single Crystal 
  1546. Reports formula to send one offer to all customers with an even customer 
  1547. number and a second offer to all customers with an odd customer number. You 
  1548. can do some remarkable manipulations using Crystal Reports formulas.
  1549.  
  1550.  
  1551. 27.8 Grouping, Summarizing, and Sorting Your Data
  1552.  
  1553. Crystal Reports allows you to group, summarize, and sort your data to 
  1554. achieve the reporting results you want.
  1555.  
  1556. 27.8.1 Grouping the Data
  1557.  
  1558. A group is a set of records that are related to each other in some way. 
  1559. In a customer list, for example, a group could consist of all those 
  1560. customers living in the same ZIP code, or in the same state. In a sales 
  1561. report, a group could consist of all the orders placed by the same customer, 
  1562. or all of the orders generated by a specific sales rep. 
  1563.  
  1564. Breaking data into groups (and then doing something to evaluate the group 
  1565. data, if you wish) is a key part of effective reporting. In fact, it's what 
  1566. separates a report from being merely a presentation of raw data and a 
  1567. valuable communication tool.
  1568.  
  1569. Crystal Reports allows you great flexibility in grouping data. It also 
  1570. gives you the ability to create a number of different kinds of group values.
  1571.  
  1572. 27.8.2 Group Values
  1573.  
  1574. A group value is the value generated as the result of an evaluation, a 
  1575. tally, or a calculation performed on data from a single group. A subtotal 
  1576. is one kind of group value; it is the sum of all of the values from a single 
  1577. field, from all the records in a group. In a sales report, for example, if 
  1578. you subtotal sales by sales rep, Crystal Reports gathers all the records 
  1579. that belong to the sales rep and totals the sales amounts from all the 
  1580. records. In a group average, Crystal Reports averages the values in a group 
  1581. of records; in a group count, it counts the values in a group of records, 
  1582. etc. Group values are important tools for creating powerful reports. 
  1583. Crystal Reports gives you several alternatives for working with group data. 
  1584. It enables you to:
  1585.  
  1586. o  calculate the sum of values, 
  1587. o  calculate the standard deviation or variance of the values,
  1588. o  average the values, 
  1589. o  count the values, 
  1590. o  determine the highest value, and
  1591. o  determine the lowest value in the group.
  1592.  
  1593. 27.8.3 Grouping Data with Crystal Reports
  1594.  
  1595. While there may be many data fields on a report, there is typically only 
  1596. one field for which you are interested in grouping the data. In a sales 
  1597. report, for example, it would probably be the field listing the amount of 
  1598. sales; in a commission report, it would probably be the field listing the 
  1599. amount of commission, etc. To group data you first select the field you 
  1600. want to group together.
  1601.  
  1602. Once the field is selected, you select the action you want to take on each 
  1603. group of data from that field:
  1604.  
  1605. o  If you want to simply group the data and take no further action, you 
  1606. can select Insert|Group.
  1607. o  If you want to subtotal it, you can select Insert|Subtotal. 
  1608. o  If you want to average, count, determine the maximum or minimum value, 
  1609. etc., you can select Insert|Summary.
  1610.  
  1611. Subtotals and summaries make up the category of group fields.
  1612.  
  1613. NOTE:  The Insert|Subtotal command is simply a shortcut for setting up 
  1614. a summary that adds the values in each group.
  1615.  
  1616. Once you have selected the group field and the action, you select another 
  1617. field (a sort and group by field) that triggers a grouping whenever its 
  1618. value changes. In grouping your data by state, for example, you would use 
  1619. the state field to create a new group (and generate a group value if 
  1620. selected) whenever the state changes. Likewise, the ZIP code field would 
  1621. trigger a grouping whenever the ZIP code changes.
  1622.  
  1623. Once you've made these simple selections, Crystal Reports does the rest. 
  1624. Your data will be grouped, and the group value (if you have selected one) 
  1625. will be calculated and will accompany each group.
  1626.  
  1627.  
  1628. 27.9 Summarizing the Data
  1629.  
  1630. Crystal Reports provides three easy-to-use summarizing options:
  1631.  
  1632. Grand Total     A grand total adds all values in a field for the entire 
  1633.         report and prints the sum on the last page.
  1634.         
  1635. Subtotal        A subtotal is a partial total, a total of a specific, 
  1636.         limited group of data in a field.
  1637.  
  1638. Summary         A summary summarizes field data from a specific, limited 
  1639.         group of records. It can total the data like a subtotal, 
  1640.         but it can also average the values, count the values, or 
  1641.         determine the highest or lowest value in each group or field.
  1642.  
  1643. All of these options are available on the Insert menu.
  1644.  
  1645. 27.9.1 The Summarizing Process
  1646.  
  1647. The process of summarizing the data on your report follows these steps:
  1648.  
  1649. 1.  Selecting the field you want to summarize.
  1650.  
  1651. 2.  Selecting the summarizing option you want from the Insert menu.
  1652.  
  1653.     Finally, if you select Subtotal or Summary as a total type, the 
  1654.     process will also include the following step:
  1655.  
  1656. 3.  Selecting the data field that triggers a new subtotal/summary 
  1657.     whenever its value changes.
  1658.  
  1659. 27.9.2 Selecting a Field to Total
  1660.  
  1661. To select the field you want to summarize, click on it with a mouse. 
  1662. Crystal Reports puts handles on the selected marker to highlight it as 
  1663. selected.
  1664.  
  1665. 27.9.3 Selecting a Total Type
  1666.  
  1667. To select a total type, select it from the Insert menu or pop-up menu.
  1668.  
  1669. 27.9.4 Selecting a Field to Trigger a New Subtotal
  1670.  
  1671. If you select Subtotal or Summary as a total type, Crystal Reports asks 
  1672. you to indicate the field that is to trigger a new subtotal/summary 
  1673. whenever its value changes. 
  1674.  
  1675. NOTE:  For additional information on subtotaling data (with examples), 
  1676. please see section 28.2.32 entitled "Sorting Your Data."
  1677.  
  1678.  
  1679. 27.10 Sorting
  1680.  
  1681. There is a logic to the way values are arranged when they appear in a 
  1682. column on your report. Initially, they are arranged in the same order as 
  1683. the data appears in your database. But data can be sorted in a variety of 
  1684. ways:
  1685.  
  1686. o  A mailing list, for example, could be sorted in ascending order, on 
  1687. the ZIP code field; that is, the customers would be sorted so that those 
  1688. with the lowest ZIP codes would appear first and those with the highest 
  1689. ZIP codes would appear last. 
  1690.  
  1691. o  It could also be sorted in ascending alphabetical order, on the last 
  1692. name field; that is, customers with last names beginning with A would 
  1693. appear first and those with last names beginning with Z would appear last. 
  1694.  
  1695. o  It could also be sorted by street address or customer first name if 
  1696. you had some practical reason for doing so. 
  1697.  
  1698. Crystal Reports gives you the opportunity to change the existing sort order 
  1699. using the Print|Record Sort Order and Print|Group Sort Order commands.
  1700.  
  1701. 27.10.1 Sorting by Record
  1702.  
  1703. When you use the Print|Record Sort Order command, Crystal Reports asks you 
  1704. to select two things:
  1705.  
  1706. o  the field you want your sort to be based on (sort field), and
  1707. o  the sort direction.
  1708.  
  1709. 27.10.2 Sort Field
  1710.  
  1711. A sort field is a field that determines the order in which data appears on 
  1712. your report. Crystal Reports sorts field data using Windows' sort 
  1713. comparison algorithms, and it uses rules specific to the Country you 
  1714. select in the International section of the Windows Control Panel.
  1715.  
  1716. You can use any field as a sort field. A field's data type determines the 
  1717. method in which the data from that field is sorted: 
  1718.  
  1719. Text            Text fields are sorted in the following manner:
  1720.         One character values are sorted so that blanks have the 
  1721.         lowest value, then punctuation, then numbers, then 
  1722.         uppercase letters, and finally lowercase letters. 
  1723.         Then two character values are sorted, then three, etc. 
  1724.         using the same rules. As a result: "BOB" comes before "bob", 
  1725.         "123" comes before "124", " " (blank) comes before "a", 
  1726.         and "aa" comes before "aaa" 
  1727.  
  1728. Dollars         Dollar fields are sorted in numeric order.
  1729.  
  1730. Number          Number values (120, or 5555) are sorted in numeric order.
  1731.  
  1732. Dates           Date fields are sorted in chronological order.
  1733.  
  1734. Booleans        Comparison fields are sorted so that false values come 
  1735.         first, then true. 
  1736.  
  1737. When you select a sort field, Crystal Reports sorts the values from 
  1738. that field.
  1739.  
  1740. 27.10.3 Sort Direction
  1741.  
  1742. Direction refers to the order in which the values are printed, once sorted. 
  1743.  
  1744. o  Ascending order means smallest to largest, 1 to 9, A to Z, False to True.
  1745. o  Descending order means largest to smallest, 9 to 1, Z to A, True to False.
  1746.  
  1747. 27.10.4 Single Field Sorts
  1748.  
  1749. Single field sorts are sorts in which all the data in the report is sorted 
  1750. based on the values in a single field. Sorting an inventory report by stock 
  1751. number and sorting a customer list by customer number are examples of single 
  1752. field sorts. 
  1753.  
  1754. 27.10.5 Multiple Field Sorts
  1755.  
  1756. In multiple field sorts, Crystal Reports first sorts the entries 
  1757. (alphabetic or numeric) in the first field selected, putting them in 
  1758. ascending or descending order as specified. Then it sorts any entries in 
  1759. the second field that can be sorted without disturbing the sort order of 
  1760. entries in the first field. It then sorts any entries in the third field 
  1761. that can be sorted without disturbing the sort order of the entries in the 
  1762. first two fields. It follows the same pattern for sorting additional fields.
  1763.  
  1764. 27.10.6 Sorting Groups
  1765.  
  1766. Crystal Reports allows you to change the order in which groups appear on 
  1767. your report. You can:
  1768.  
  1769. o  base the sort on any group (subtotal or summary) in your report, and
  1770. o  sort your report so that group field values appear in ascending or 
  1771. descending order.
  1772.  
  1773. You change the sort order using the Print|Group Sort Order command. When 
  1774. you sort by group, nothing happens to the sort order of the records within a 
  1775. group; only the relative positions of the groups themselves change.
  1776.  
  1777. NOTE:  For additional information on sorting and examples of single field, 
  1778. multiple field, and group sorts, please see section 28.2.32 entitled 
  1779. "Sorting YourData."
  1780.  
  1781.  
  1782. 27.11 Editing and Formatting the Data
  1783.  
  1784. Crystal Reports makes it easy to edit and format your data. The 
  1785. editing/formatting process follows these steps:
  1786.  
  1787. 1.  Selecting the data you want to edit or format.
  1788.  
  1789. 2.  Selecting the editing or formatting action you want to take place. 
  1790.  
  1791. 3.  Entering the specifics of the action in the dialog box/editor 
  1792.     if/when it appears.
  1793.  
  1794. 27.11.1 Selecting the Data
  1795.  
  1796. To select the data element you want to edit or format, you click on it 
  1797. with your mouse. Crystal Reports draws handles on the element marker to 
  1798. highlight it as selected.
  1799.  
  1800. 27.11.2 Selecting the Action
  1801.  
  1802. Once the element is selected, you select the editing or formatting action 
  1803. from Crystal Reports' Edit or Format menus. For example:
  1804.  
  1805. o  to change the font used to print the data, select Font from the Format 
  1806. menu,
  1807. o  to hide the field when printing, select Field from the Format menu, or
  1808. o  to modify a formula, select Formula from the Edit menu.
  1809.  
  1810. 27.11.3 Entering the Specifics
  1811.  
  1812. In those cases where a dialog box or editor appears after you've selected 
  1813. an action, you enter the specifics of that action in the window that appears. 
  1814. For example:
  1815.  
  1816. o  in the Font dialog box, you enter the font and point size you wish to 
  1817. use, and indicate whether you want the data to appear in boldface or italics, 
  1818. or whether you want it to be underlined or overprinted with the strikeout 
  1819. character, and
  1820.  
  1821. o  in the Formula Editor, you make the changes you want to the formula that 
  1822. appears, check those changes if you wish, and accept the revised formula 
  1823. when you're finished. 
  1824.  
  1825. Crystal Reports takes it from there and performs the action you selected.
  1826.  
  1827. NOTE:  In some cases you have to specify a second action to complete the 
  1828. editing change desired. For example, to move some text in your report, you 
  1829. first cut the text from its current position, and then you paste it in its 
  1830. new position. In such a case you select the data and then the action (Cut) 
  1831. to cut the text to the clipboard. Then you mark the new position using the 
  1832. insertion pointer and select Paste to insert the text in the new position.
  1833.  
  1834.  
  1835. 27.12 Specifying Records/Groups to be Included
  1836.  
  1837. When you select a field to appear on your report, Crystal Reports, by 
  1838. default, prints field values from every record in the selected database. 
  1839. But in many cases you may not want to include all the values, but only a 
  1840. specific range of values. For example, you may want to include only a 
  1841. specific group of customers or a specific range of account numbers out of 
  1842. the total number of values in the database. Or you may want to include 
  1843. values from only those records that fall within a particular date range. 
  1844. With Crystal Reports this is easy. The program includes four commands on the 
  1845. Print menu for restricting your report to specific records or groups of 
  1846. records as described in the following sections:
  1847.  
  1848. 27.12.1 Select Records
  1849.  
  1850. This option allows you to limit your report to specific records that fit a 
  1851. condition or conditions you specify. It automatically builds a record 
  1852. selection formula using your responses to dialog box questions. This option 
  1853. requires no knowledge of the Crystal Reports formula language.
  1854.  
  1855. 27.12.2 Edit Record Selection Formula
  1856.  
  1857. This option also allows you to limit your report to specific records that 
  1858. fit a condition or conditions you specify. It takes you to the Formula 
  1859. Editor where you can manually build a record selection formula to fit 
  1860. your needs. This command is intended for users who are familiar with the 
  1861. Crystal Reports formula language.
  1862.  
  1863. 27.12.3 Select Groups
  1864.  
  1865. This option allows you to limit your report to specific groups that fit a 
  1866. condition or conditions you specify. It automatically builds a group 
  1867. selection formula using your responses to dialog box questions. This 
  1868. option requires no knowledge of the Crystal Reports formula language.
  1869.  
  1870. 27.12.4 Edit Group Selection Formula
  1871.  
  1872. This option also allows you to limit your report to specific groups of 
  1873. records that fit a condition or conditions you specify. It takes you to 
  1874. the Formula Editor where you can manually build a group selection formula 
  1875. to fit your needs. This command is intended for users who are familiar with 
  1876. the Crystal Reports formula language.
  1877.  
  1878. You select the command, specify the records or groups of records you want 
  1879. included, and your report prints using only the selected records or groups.
  1880.  
  1881.  
  1882. 27.13 Printing the Finished Report
  1883.  
  1884. When you want to print your report or when you want to see what your report 
  1885. will look like when printed, use Crystal Reports' three printing options:
  1886.  
  1887. o  printing to the printer for hard copy output
  1888. o  printing to a print window to review your work
  1889. o  printing to a disk file for use with other applications
  1890.  
  1891. All of these options are available on the Print menu.
  1892.  
  1893. When you are creating a report, you will find yourself printing to the 
  1894. print window often, in order to check placement and formatting of the 
  1895. various report elements. The print window even includes a print preview 
  1896. function that lets you see each page of your report as a whole, top to 
  1897. bottom. Then, when you want to print a final or interim copy of the report 
  1898. for hands-on review, you can print to the printer for hard copy output. 
  1899.  
  1900. If you want to use your report data in another application (in a spreadsheet 
  1901. or word processor for example), you can print the report to a disk file in 
  1902. any of a variety of popular file formats. Once in a disk file, you can import 
  1903. the data into your other application following the importing procedures 
  1904. established by the receiving application.
  1905.  
  1906.  
  1907.  
  1908. 28.0 Practical Crystal Reports
  1909.  
  1910. This chapter contains a number of topics on the practical aspects of using 
  1911. Crystal Reports to solve typical reporting problems.
  1912.  
  1913.  
  1914. 28.1 Practical Crystal Reports
  1915.  
  1916. This chapter contains a number of topics on the practical aspects of 
  1917. using Crystal Reports to solve typical reporting problems. The topics 
  1918. are broken down into the following groups:
  1919.  
  1920.  
  1921. Creating a report               Topics on a variety of report creation skills.
  1922.  
  1923. Manipulating text and data      Topics that show you how to manipulate (copy, 
  1924.                 delete, move, etc.) text and data on your 
  1925.                 report.
  1926.  
  1927. Working with graphics and       Topics that show you how to size, scale, 
  1928. graphic enhancements            crop, and fine tune the placement of   
  1929.                 bit-mapped graphics, and how to create, size, 
  1930.                 and position lines, boxes, and tables on 
  1931.                 your report.
  1932.  
  1933.  
  1934. 28.2 Creating a Report
  1935.  
  1936. This section leads you through the following report creation topics:
  1937.  
  1938. o  Selecting a database
  1939. o  Selecting additional databases
  1940. o  Linking the databases 
  1941. o  Understanding the invisible grid 
  1942. o  Creating margins
  1943. o  Inserting fields
  1944. o  Selecting fields to move, format, etc.
  1945. o  Spacing fields
  1946. o  Inserting text 
  1947. o  Selecting text (to delete, change the font, etc.)
  1948. o  Aligning text with fields
  1949. o  Inserting blank lines
  1950. o  Deleting blank lines 
  1951. o  Changing field and text fonts 
  1952. o  Highlighting fields with borders and drop shadows 
  1953. o  Centering text, field values
  1954. o  Inserting page headers and footers 
  1955. o  Inserting page numbers and other special fields 
  1956. o  Grouping data
  1957. o  Summarizing grouped data
  1958. o  Creating group headers 
  1959. o  Sorting your data 
  1960. o  Hiding parts of the report when printing 
  1961. o  Selecting records and groups you want included on your report. 
  1962. o  Selecting page orientation and paper size
  1963.  
  1964. 28.2.1 Selecting a Database
  1965.  
  1966. Begin the report creation process by selecting (activating) a database. 
  1967. Once activated, the database serves as a source from which you can select 
  1968. fields to appear on your report and to be included in report formulas.
  1969.  
  1970. Select a database using the New Report command on the File menu. 
  1971.  
  1972. 28.2.2 Selecting Additional Databases
  1973.  
  1974. Crystal Reports allows you to draw data from multiple databases for use in 
  1975. a single report. Select the first database you want to use from the Choose 
  1976. Database File dialog box that appears when you select New Report from the 
  1977. File Menu. Select the second and each additional database using the Add File 
  1978. to Report command on the Database menu. 
  1979.  
  1980. 28.2.3 Linking the Databases
  1981.  
  1982. You link databases so that records from one database will match up with 
  1983. records from another. For example, if you activate a Customer database and 
  1984. an Order database, you link the databases so that orders in the Order 
  1985. database can be matched up with the customers who placed the orders (from 
  1986. the Customer database). 
  1987.  
  1988. Links are fields that are common to the two databases. The fields don't 
  1989. have to have the same name; but they must have the same structure (size, 
  1990. data type), and contain the same kind of data.
  1991.  
  1992. o  When you activate additional databases using the Database|Add File to 
  1993. Report command, Crystal Reports takes you directly to the Define Link dialog 
  1994. box. You use this dialog box to establish the link between the database 
  1995. you are activating and a database which is already active.
  1996.  
  1997. o  If you later wish to create new links, or update or delete existing 
  1998. links, you use the Database|Links command which takes you to the Links 
  1999. dialog box. Use this dialog box for a variety of linking activities.
  2000.  
  2001. 28.2.4 Understanding the Invisible Grid
  2002.  
  2003. The Report Editor looks very freeform. It looks like you can place anything 
  2004. anywhere and hope for good results. But that is not the case. The Editor 
  2005. contains an invisible grid which directly affects the placement of data 
  2006. fields and text fields. 
  2007.  
  2008. Think of the grid as a series of row and column coordinates. Crystal Reports 
  2009. allows you to place fields and text only at these coordinates, not between 
  2010. them. In this way it makes it very easy for you to place and space data on 
  2011. your report, and to align text and fields as needed. If you attempt to 
  2012. place a report element between grid coordinates, Crystal Reports "snaps" the 
  2013. element to the grid (i.e., it moves the element automatically to the 
  2014. nearest coordinate).
  2015.  
  2016. o  When you place a data field in the Report Editor, Crystal Reports 
  2017. "snaps" it to the nearest coordinate. Use the arrow keys or the mouse 
  2018. to move the fields once they have been placed.
  2019.  
  2020.     - When you use the arrow keys to move the field, each time you 
  2021.     press the arrow the field moves one grid position.
  2022.     - When you use the mouse to drag the field to a new location, 
  2023.     Crystal Reports "snaps" the field to the nearest coordinate as the 
  2024.     field moves.
  2025.  
  2026. o  When you type text in the Report Editor, Crystal Reports always begins 
  2027. the text at a grid coordinate.
  2028.  
  2029.     - Use the Tab key to move the text; each time you press the Tab 
  2030.     key the text moves six grid positions
  2031.  
  2032. NOTE:  Crystal Reports uses a four pixel horizontal grid and a vertical 
  2033. grid that is variable, based on the line height assigned to the largest 
  2034. font used within a report section.
  2035.  
  2036. 28.2.5 Creating Margins
  2037.  
  2038. Set margins in Crystal Reports using the Print|Set Printer Margins 
  2039. command. 
  2040.  
  2041. o  Crystal Reports uses a dashed line to display your margins in the 
  2042. Report Editor and Label Editor.
  2043.  
  2044. o  The displayed margins are active: they define the outer printing 
  2045. limits of the report or label. Crystal Reports will not allow you to place 
  2046. or move a field or text so it extends beyond the margins.  
  2047.  
  2048. o  The numeric margin settings appear in both the Mailing Labels dialog 
  2049. box and in the Printer Margins dialog box.
  2050.  
  2051. o  When you create a new report, Crystal Reports uses the non-printing 
  2052. areas established for your printer as default margins. For example, if 
  2053. your printer specifications indicate that the left quarter inch of a 
  2054. page is a non-printing area, Crystal Reports sets the default left margin 
  2055. at .25 inches. While you can set margins that fall inside the non-printing 
  2056. areas, parts of your report may be clipped off if you do.
  2057.  
  2058. o  All margins are calculated from the paper edge. Thus, a left margin 
  2059. of .25 inches causes the printing to start exactly one quarter inch in 
  2060. from the edge of the paper.
  2061.  
  2062. 28.2.6 Inserting Fields
  2063.  
  2064. Insert fields on your report using the Database Field command on the 
  2065. Insert menu. 
  2066.  
  2067. 28.2.7 Selecting Fields to Move, Format, etc.
  2068.  
  2069. To do many things with a field (change the font, move it, etc.), first you 
  2070. must to select it. Select means to point to the element with the mouse 
  2071. and then to click the left mouse button to choose the element as the 
  2072. object of the next menu selection. For example, to change font size, you 
  2073. first select the element for which you want to change the font size. Then 
  2074. you select the Font option from the Format menu (or Change Font from the 
  2075. right mouse button menu) to select the new font size. The new font size 
  2076. applies only to the field you selected.
  2077.  
  2078. When you select a field, black handles appear on the field box. These 
  2079. handles indicate that the field is selected, and therefore active. 
  2080.  
  2081. 28.2.8 Selecting Multiple Fields at One Time
  2082.  
  2083. To select multiple fields at one time, press the Shift key and, while 
  2084. keeping it depressed, click the various fields you want to select. Handles 
  2085. will appear on each field selected. You can then move or delete the fields 
  2086. as a group. You can also change the font or formatting or add borders 
  2087. for all selected fields.
  2088.  
  2089. 28.2.9 Spacing Fields
  2090.  
  2091. Set spacing between data fields by placing the fields where you want 
  2092. them in the Report Editor (using the mouse or Arrow keys), checking your 
  2093. spacing using the Print|Print to Window command, and then fine-tuning the 
  2094. spacing, again in the Report Editor.
  2095.  
  2096. 28.2.10 Spacing Considerations
  2097.  
  2098. The following items that can affect column spacing:
  2099.  
  2100. o  Field size - The amount of space allotted for a field may be much greater 
  2101. than the size of the value that appears in the field. 
  2102.  
  2103.     - In a number or dollar amount field (which is right justified 
  2104.     by default), this can create a large number of leading blank 
  2105.     spaces which can impact field spacing. 
  2106.     - In all other fields (which are left justified by default), it 
  2107.     can create a large number of trailing blank spaces which can 
  2108.     impact field spacing. 
  2109.  
  2110. You can reduce the amount of space allotted for a field by selecting the 
  2111. field and then resizing it using the mouse or a Shift-Left Arrow or 
  2112. Shift-Right Arrow key combination.
  2113.  
  2114. o  Mouse - To reduce the size of a field in the Report Editor using the 
  2115. mouse, select the field and then drag either of the handles to make the 
  2116. field box smaller.
  2117.  
  2118. o  Shift-Left Arrow key - To reduce the size of a field in the Report 
  2119. Editor using the Shift-Arrow key combination, select the field, press the 
  2120. Shift key, and, while keeping it depressed, press the Left Arrow key enough 
  2121. times to reduce the field to the desired size.
  2122.  
  2123. NOTE:  If you have set up a data block of fields in the Report Editor 
  2124. (i.e., Customer/Address/City in a customer list report), you can resize 
  2125. all of the fields simultaneously once. First, click each of the fields while 
  2126. holding down the Shift key. Then resize the fields by dragging on one of the 
  2127. sizing handles from any of the selected fields (using the mouse) or by using 
  2128. the Shift-Arrow key combination.
  2129.  
  2130. o  Alignment - Number and dollar amount fields are right justified by 
  2131. default; all other data types are left justified. A right aligned field 
  2132. following a left aligned field may appear to be spaced properly in the Report 
  2133. Editor. You may need to fine tune the spacing, however, once you review 
  2134. the report in the Print Window.
  2135.  
  2136. 28.2.11 Inserting Text (Titles, Labels, etc.)
  2137.  
  2138. You can add text to your report by typing it at the insertion point and 
  2139. then moving it into place or, by using the Insert|Text Field command.  
  2140.  
  2141. Use the following procedure to insert text directly on your report:
  2142.  
  2143. 1.  Move the I-beam cursor to the line on which you wish to enter text. 
  2144.  
  2145. 2.  Click the left mouse button to set the insertion point at the left 
  2146.     margin of the Report Editor.
  2147.  
  2148. 3.  Type in your text.
  2149.  
  2150. 4.  Move the I-beam cursor in front of the text, click to set the insertion 
  2151.     point and push the text into position using the Tab key. 
  2152.  
  2153. Use the following procedure to insert text using a text field:
  2154.  
  2155. 1.  Select Insert|Text Field. 
  2156.     
  2157.     The Edit Text Field dialog box appears. 
  2158.  
  2159. 2.  Enter your text in the Enter Text edit box, and click OK when finished. 
  2160.     
  2161.     A rectangular placement cursor appears and changes into a field box 
  2162.     when it enters the Report Editor. 
  2163.  
  2164. 3.  Position the field box where you want the text field to appear and 
  2165.     click the left mouse button to place it.
  2166.  
  2167. NOTE:  By default, Crystal Reports automatically places a title in the 
  2168. Page Header section to identify each field or formula field you insert in 
  2169. your report. These titles are simply text fields. As such, they can be 
  2170. moved, formatted, deleted, resized, or edited to change the text.
  2171.  
  2172. o  For fields, the default title is the name of the field.
  2173. o  For formulas, the default title is the name of the formula.
  2174.  
  2175. The left edge of each title aligns with the left edge of the field 
  2176. it identifies.  Automatic titles can be toggled off and on via the Insert 
  2177. Detail Field Titles option in the Options dialog box.
  2178.  
  2179. 28.2.12 Selecting Text (To Delete, Change the Font, etc.)
  2180.  
  2181. To do many things with text (change the font, delete it, etc.), first you 
  2182. must to select it. Select means to highlight the text by dragging the 
  2183. I-beam cursor over it while holding down the left mouse button. Your next 
  2184. action (changing the font, selecting Edit|Cut, etc.) acts upon the text 
  2185. selected.
  2186.  
  2187. NOTE:  When text is in a text field, you select it as you would select 
  2188. any field.
  2189.  
  2190. 28.2.13 Aligning Text with Fields
  2191.  
  2192. Often in reporting, you may find yourself wanting to align text with column 
  2193. data (that you entered as fields or formula fields). To do this, place 
  2194. your fields, type your text, and then move the text into position using the 
  2195. Tab key. It is important to understand why you use the Tab key to perform 
  2196. this function and not the Space Bar. Spaces on the screen take up a 
  2197. different amount of space than spaces on the printer. Thus, what looks like 
  2198. it is aligned on screen (using the Space Bar) may not be aligned when you 
  2199. print. If text and fields are aligned to a given tab stop on screen, however, 
  2200. the elements will also be aligned when you print. Since both elements are 
  2201. aligned to the same tab stop, a tab expansion can affect only the absolute 
  2202. position of the elements on a page, not their alignment relative to each 
  2203. other. 
  2204.  
  2205. To align text with fields, you move the text, the field, or both. 
  2206.  
  2207. o  Move the text with the Tab key. Each time you press the Tab key the 
  2208. text moves six grid positions. 
  2209.  
  2210. o  Move the fields with the Arrow keys. Each time you press one of the 
  2211. Arrow keys, the text moves one grid position. 
  2212.  
  2213. NOTES:  a - If you want to center the text over a field, or right or 
  2214. left align it, you can type the text into a text field and use the 
  2215. Format|Field alignment commands to set the alignment of the text within 
  2216. the text field. 
  2217. b - Text can be moved right and left (with the Tab and Backspace keys) as
  2218. can fields (with the Right Arrow and Left Arrow keys). By moving text and 
  2219. fields in concert, you should be able to get good alignment easily.  
  2220. c - To align field titles with fields, working from left to right is best. 
  2221. Make certain the first title is aligned with its field, then align the 
  2222. second title with its field, etc. Aligning, in this case, consists of 
  2223. aligning the left edge of the title with the left edge of the field.
  2224. d - For the best (and easiest) alignment of text and field data, enter 
  2225. your text elements as text fields using the Insert|Text Field command 
  2226. (instead of entering the text directly onto the report).
  2227.  
  2228. 28.2.14 Inserting Blank Lines
  2229.  
  2230. To insert a blank line, move the I-beam cursor to the section in which 
  2231. you want to enter the blank line, click the left mouse button to set the 
  2232. insertion point, and press Enter one time for each blank line you want to 
  2233. insert.
  2234.  
  2235. Considerations:
  2236.  
  2237. o  If you place the insertion point before text and then press Enter, 
  2238. the blank lines will appear above the text.
  2239.  
  2240. o  If you place the insertion point after text and then press Enter, 
  2241. the blank lines will appear below the text.
  2242.  
  2243. o  If you place the insertion point before or after a field and then 
  2244. press Enter, the blank lines will always appear below the field. If you 
  2245. want to insert blank lines above the field, insert the number of blanks 
  2246. you need below the field as indicated, and then move the field down to 
  2247. the bottom blank line you have just created.
  2248.  
  2249. NOTE:  You can also add blank lines by dragging the section boundary to 
  2250. increase section size. 
  2251.  
  2252. 28.2.15 Deleting Blank Lines
  2253.  
  2254. By default the Report Editor allots three lines for the Page Header section 
  2255. and three lines for the Page Footer section of your report. The defaults 
  2256. may allot more lines than you need for those items on your report.  
  2257.  
  2258. Additionally, you may expand a section on your report by a random number 
  2259. of lines prior to inserting text and data, just to make sure you have 
  2260. enough room for your entries. You may find that you have added more lines 
  2261. than necessary.
  2262.  
  2263. Printing the report without first deleting the unneeded blank lines can 
  2264. leave gaps in your report that make the report less attractive visually 
  2265. and more difficult to read.
  2266.  
  2267. To delete unneeded blank lines:
  2268.  
  2269. o  If an entire section is blank (i.e., if you aren't putting anything 
  2270. into the Page Footer section of your report), you can eliminate the 
  2271. allotted blank lines by eliminating the entire report section via the Hide 
  2272. Section option of the Format Section command.
  2273.  
  2274. o  If you have text and/or data in a section and just want to remove the 
  2275. extraneous blank lines, click the I-beam cursor on the blank line you want 
  2276. to delete. This sets the insertion point. Once the insertion point is set, 
  2277. press the Backspace key (the key that deletes the previous character); 
  2278. Crystal Reports deletes the line on which the insertion point is set.
  2279.  
  2280. NOTE:  You can also delete blank lines by dragging the section boundary to 
  2281. decrease section size. 
  2282.  
  2283. 28.2.16 Changing Field and Text Fonts
  2284.  
  2285. You can change fonts quickly for any field value or text string in your 
  2286. report using the Font dialog box.
  2287.  
  2288. Use the following procedure to change fonts for a field value.
  2289.  
  2290. 1.  Select the field(s) for which you want to change the font.
  2291.  
  2292.     o To select a single field, click the field.
  2293.     o To select multiple fields, hold the Shift key down while you 
  2294.     click the fields.
  2295.  
  2296.     Handles appear on the selected field(s).
  2297.  
  2298. 2.  Select Format|Font or click the right mouse button and select Change 
  2299.     Font from the pop-up menu. 
  2300.  
  2301.     The Font dialog box appears.
  2302.  
  2303. 3.  Make the font, style, size, color, and/or effects changes you want 
  2304.     and click OK when finished.
  2305.  
  2306. Use the following procedure to change fonts for a text string:
  2307.  
  2308. 1.  With the left mouse button depressed, drag the I-beam cursor over the 
  2309.     text of interest to select it.
  2310.  
  2311. 2.  Select Format|Font or click the right mouse button and select Change 
  2312.     Font from the pop-up menu. 
  2313.     
  2314.     The Font dialog box appears.
  2315.  
  2316. 3.  Make the font, style, size, color, and/or effects changes you want and 
  2317.     click OK when finished.
  2318.  
  2319. 28.2.17 Highlighting Fields with Borders and Drop Shadows
  2320.  
  2321. Crystal Reports makes it easy for you to highlight your data with borders 
  2322. and drop shadows, and color. 
  2323.  
  2324. Use the following procedure to create borders, drop shadows, and add field 
  2325. color:
  2326.  
  2327. 1.  Select the field(s) you want to highlight.
  2328.  
  2329.     o  To select a single field, click the field.
  2330.     o  To select multiple fields, hold the Shift key down while you 
  2331.     click the fields. 
  2332.     
  2333.     Handles appear on the selected field(s).
  2334.  
  2335. 2.  Select Format|Border and Colors or click the right mouse button and 
  2336.     select Change Border and Colors from the pop-up menu. 
  2337.  
  2338.     The Format Border and Colors dialog box appears.
  2339.  
  2340. 3.  Set up the text color, fill (field color), border, and drop shadow you 
  2341.     want.
  2342.  
  2343. 4.  Click OK when finished to return to the Report Editor. 
  2344.  
  2345.     The selected fields will be highlighted to your specifications.
  2346.  
  2347. NOTE:  If you selected multiple fields, the same highlights will be applied 
  2348. to all fields. If you want to highlight different fields differently, you 
  2349. must select and highlight each unique field individually.
  2350.  
  2351. 28.2.18 Centering Text, Field Values
  2352.  
  2353. To center text and field values, you use the Crystal Reports' alignment 
  2354. command. 
  2355.  
  2356. Use the following procedure to center text under a title, over the body of 
  2357. the report, etc.
  2358.  
  2359. 1.  Select Insert|Text Field and create a text field that contains the 
  2360.     text you want.
  2361.  
  2362. 2.  Place the text field in the approximate position you want it to appear 
  2363.     on the report. 
  2364.  
  2365. 3.  Change the font, font size, and font style for the text field if you 
  2366.     wish. 
  2367.  
  2368. 4.  Resize the text field box so it matches the margins within which you 
  2369.     wish to center the text. 
  2370.  
  2371.     For example, if you want to center text beneath a report title, expand 
  2372.     the field box so it's the same size as the report title (or report 
  2373.     title field box). If you want to center a header entry over the body of 
  2374.     the report, expand the header entry field box so it's the same width as 
  2375.     the data in your report. 
  2376.  
  2377. 5.  Select Format|Field, and then select centered from the Alignment box in 
  2378.     the Field Format dialog box when it appears. 
  2379.  
  2380. 6.  Select OK when finished; Crystal Reports centers your text within the 
  2381.     expanded field box. 
  2382.  
  2383. Use the following procedure to center a field value within the space 
  2384. allotted for the field:
  2385.  
  2386. 1.  Select the field whose value you want to center.
  2387.  
  2388. 2.  Change the font, font size, and font style for the field if you wish. 
  2389.  
  2390. 3.  Select Format|Field, and then select centered from the Alignment box 
  2391.     in the Field Format dialog box when it appears. 
  2392.  
  2393. 4.  Select OK when finished; Crystal Reports centers the field value within 
  2394.     the space allotted for the field.
  2395.  
  2396. 28.2.19 Inserting Page Headers and Footers
  2397.  
  2398. In many cases, you may want to include information at the top and bottom 
  2399. of each page of your report.
  2400.  
  2401. o  At the top of the report (page header) you may want to include such 
  2402. things as the report title, the report date, the range of dates covered by 
  2403. the report, etc.
  2404.  
  2405. o  At the bottom of the report (page footer) you may want to print the page 
  2406. number, the author's name, "Confidential," etc.
  2407.  
  2408. Crystal Reports makes it easy for you to include such header and footer 
  2409. information.
  2410.  
  2411. 28.2.20 To Insert Page Headers and Footers
  2412.  
  2413. You insert page headers and footers by placing the desired information in 
  2414. the appropriate section of the report editor.
  2415.  
  2416. o  header information goes in the Page header section
  2417. o  footer information goes in the Page footer section
  2418. o  Any information you place in these sections prints on each page of the 
  2419. report (unless you take special steps to prevent some printing).
  2420. o  You can use text, fields, or formulas in these sections just as you can 
  2421. in the Details section.
  2422.  
  2423. 28.2.21 To Format Page Headers and Footers
  2424.  
  2425. You can format each element in a header or footer in the same way you 
  2426. would format that element if it appeared in the details section:
  2427.  
  2428. o  you can change the font for text, fields, or formulas (see Format|Font),
  2429.  
  2430. o  you can center the values horizontally on the page, center them over 
  2431. your report data, or align them flush left, centered, or flush right 
  2432. within the space allotted for them,
  2433.  
  2434. o  you can change the way dates, numbers, and currency appear when they 
  2435. print, (see Format|Field) and
  2436.  
  2437. o  you can suppress any blank lines that occur in the section (see 
  2438. Format|Section).
  2439.  
  2440. To format a header or footer element, select the element and then select 
  2441. the formatting option of interest.
  2442.  
  2443. 28.2.22 Inserting Page Numbers and Other Special Fields
  2444.  
  2445. Crystal Reports lets you insert special fields in your reports (in addition 
  2446. to the data fields you draw from databases). These special fields allow you 
  2447. to insert dates, page numbers, and group and record numbers in your report.
  2448.  
  2449. Print Date Field        Use Insert|Print Date Field to insert a field 
  2450.             that prints whatever is the current date when 
  2451.             the report prints.
  2452.  
  2453. Page Number Field       Use Insert|Page Number Field to insert a field 
  2454.             that prints the current page number.
  2455.  
  2456. Record Number Field     Use Insert|Record Number Field to have Crystal 
  2457.             Reports number each record printed in the Details 
  2458.             section of your report.
  2459.  
  2460. Group Number Field      Use Insert|Group Number Field to have Crystal 
  2461.             Reports number each group in your report.
  2462.  
  2463.  
  2464. When you select any of these special fields, a rectangular placement cursor 
  2465. appears. Move the cursor to the point where you want to insert the field and 
  2466. click the left mouse button to place it.
  2467.  
  2468. 28.2.23 Grouping Data
  2469.  
  2470. Grouping data means breaking your data into meaningful groups before it 
  2471. appears on your report. Crystal Reports makes it easy:
  2472.  
  2473. o  to group your data, and 
  2474. o  to evaluate or perform calculations on the data in each group should 
  2475. you so wish.
  2476.  
  2477. 28.2.24 Simple Grouping
  2478.  
  2479. Simple grouping means breaking the data into groups without performing any 
  2480. additional action (totaling, averaging, etc.) on the grouped data.
  2481.  
  2482. o  On a customer list, for example, you may want to group your data by 
  2483. state for use by your customer service or telemarketing personnel. Crystal 
  2484. Reports can quickly organize your data into state groups so that each group 
  2485. contains only customers from a single state. 
  2486.  
  2487. o  On a sales report you may want to group data by salesrep (each group 
  2488. containing only sales made by a single salesrep) or by customer (each group 
  2489. containing only sales made to a single customer). Crystal Reports 
  2490. gives you the flexibility to group data in a variety of ways.
  2491.  
  2492. NOTE:  Whenever Crystal Reports groups data, it first sorts the data, and 
  2493. then it breaks the sorted data into groups. For example, if you want to 
  2494. group a customer list by state, Crystal Reports first sorts the data by 
  2495. state. Then it begins a new group whenever the state changes. The following 
  2496. data shows that process.
  2497.  
  2498. If all you want to do is group your data, you can do this easily with 
  2499. Crystal Reports using the Insert|Group command.
  2500.  
  2501. Use the following procedure to do simple grouping:
  2502.  
  2503. 1.  Select the field you want to group. 
  2504.  
  2505.     For example:
  2506.  
  2507.     - if you want to group a customer list by state, select the field 
  2508.     that contains the company name, or 
  2509.     - if you want to group an orders report by customer, select the 
  2510.     field that contains the order amount.
  2511.  
  2512. 2.  Select Insert|Group Section. The Insert Group Section dialog box appears.
  2513.  
  2514. 3.  In the top scroll box, select the field that you want to trigger a 
  2515.     grouping, whenever its value changes. 
  2516.  
  2517.     For example:
  2518.  
  2519.     - if you want to group a customer list by state, select the state 
  2520.     field, or 
  2521.     - if you want to group an orders report by customer, select the 
  2522.     field that contains the customer name or customer number.
  2523.  
  2524. 4.  In the second scroll box, select the sort direction (in ascending order 
  2525.     = A to Z, 0 to 9, in descending order = Z to A, 9 to 0).
  2526.  
  2527. 5.  If you selected a date or Boolean field in the top scroll box, a third 
  2528.     scroll box appears near the bottom of the dialog box. In this 
  2529.     scroll box, select the date or Boolean condition that finalizes your 
  2530.     subtotal specification.
  2531.  
  2532. 6.  Select OK when finished. Crystal Reports sorts the data and then breaks 
  2533.     it into groups according to your specifications.
  2534.  
  2535. NOTE:  You can tell that the data is grouped because two new sections 
  2536. appear in the Report Editor bracketing the Details section. 
  2537.  
  2538. 28.2.25 Nesting Groups
  2539.  
  2540. You may also want to nest groups of data: group data within a group. 
  2541. For example, on a customer list, you may want to group your data by state, 
  2542. and then, within each state group, break the data down further, by city. 
  2543.  
  2544. Crystal Reports lets you do this easily: you use the Insert|Group Section 
  2545. command two times, first to set up the state group and then to set up the 
  2546. city group.
  2547.  
  2548. NOTE:  You can add additional nesting levels as needed; there is no 
  2549. practical limit to how many nesting levels you can set up.
  2550.  
  2551. Use the following procedure to group using nesting groups.
  2552.  
  2553. 1.  Select the field you want to group. 
  2554.  
  2555.     For example:
  2556.  
  2557.     - if you want to group a customer list by state and then, within 
  2558.     each state group, group the list by city, select the field that 
  2559.     contains the company name, or 
  2560.     - if you want to group an orders report by customer and then, 
  2561.     within each customer group, group the list by date, select the 
  2562.     field that contains the order amount.
  2563.  
  2564. 2.  Select Insert|Group Section. 
  2565.  
  2566.     The Insert Group Section dialog box appears.
  2567.  
  2568. 3.  In the top scroll box, select the field that you want to trigger a 
  2569.     grouping, whenever its value changes. 
  2570.  
  2571.     For example:
  2572.  
  2573.     - if you want to group a customer list by state and then by city, 
  2574.     select the state field, or 
  2575.     - if you want to group an orders report by customer and then by 
  2576.     date, select the field that contains the customer name or customer 
  2577.     number.
  2578.  
  2579. 4.  In the second scroll box, select the sort direction (in ascending order 
  2580.     = A to Z, 0 to 9, in descending order = Z to A, 9 to 0)
  2581.  
  2582. 5.  If you selected a date or Boolean field in the top scroll box, a third 
  2583.     scroll box appears near the bottom of the dialog box. In this 
  2584.     scroll box, select the date or Boolean condition that finalizes your 
  2585.     subtotal specification.
  2586.  
  2587. 6.  Select OK when finished. 
  2588.  
  2589.     Crystal Reports groups the data according to the first set of 
  2590.     specifications. 
  2591.  
  2592. 7.  Select the same field you selected in Step 1.
  2593.  
  2594. 8.  Select Insert|Group Section again. 
  2595.     
  2596.     The Insert Group Section dialog box appears.
  2597.  
  2598. 9.  This time select the field you want to trigger the second group (the 
  2599.     group within the group) whenever its value changes. 
  2600.  
  2601.     For example:
  2602.  
  2603.     - if you want to group a customer list by state and then by city, 
  2604.     select the city field, or 
  2605.     - if you want to group an orders report by customer and then by 
  2606.     date, select the date field.
  2607.  
  2608. 10. Select the sort direction (ascending = A to Z, 0 to 9, descending = 
  2609.     Z to A, 9 to 0).
  2610.  
  2611. 11. Select OK when finished. Crystal Reports groups the data, this time 
  2612.     using both sets of specifications. 
  2613.  
  2614. 12. Repeat Steps 6 to 10 for each additional group you want to set up.
  2615.  
  2616. 28.2.26 Summarizing Grouped Data
  2617.  
  2618. Sometimes you may want to go beyond mere grouping of data. You may want to 
  2619. first group the data and then evaluate or perform calculations on the data 
  2620. in each group. You may want to sum, average, or count the values, calculate 
  2621. the variance or standard deviation of the values, or determine the highest 
  2622. (maximum) or lowest (minimum) value in each group.
  2623.  
  2624. o  You can sum the data using the Insert|Subtotal or Insert|Summary commands. 
  2625.  
  2626. o  You can sum, average, count, calculate the variance or standard 
  2627. deviation, or determine the maximum or minimum values using the 
  2628. Insert|Summary commands.
  2629.  
  2630. NOTE:  Not all summary options are available for every data type. For 
  2631. example, you cannot sum or average string fields.
  2632.  
  2633. 28.2.27 Grouping and Summarizing Grouped Data
  2634.  
  2635. 1.  Select the field you want to group. 
  2636.  
  2637.     For example:
  2638.  
  2639.     - if you want to group a customer list by state and then count the 
  2640.     number of values in each group, select the field that contains 
  2641.     the company name, or 
  2642.     - if you want to group an orders report by customer and then 
  2643.     determine the average sized order for each customer, select the 
  2644.     field that contains the order amount.
  2645.  
  2646. 2.  Select Insert|Summary. 
  2647.  
  2648.     The Insert Summary dialog box appears.
  2649.  
  2650. 3.  In the top scroll box, select the action you want to take on the 
  2651.     grouped data. 
  2652.  
  2653.     For example:
  2654.  
  2655.     - if you want to count the number of values in each group, select 
  2656.     Count, or
  2657.     - if you want to average the values in each group, select Average.
  2658.  
  2659. 4.  In the next scroll box, select the field that you want to trigger a 
  2660.     grouping, whenever its value changes. 
  2661.  
  2662.     For example:
  2663.  
  2664.     - if you want to group a customer list by state, select the state 
  2665.     field, or 
  2666.     - if you want to group an orders report by customer, select the 
  2667.     field that contains the customer name or customer number.
  2668.  
  2669. 5.  In the next scroll box select the sort direction (ascending = A to Z, 
  2670.     0 to 9, descending = Z to A, 9 to 0).
  2671.  
  2672. 6.  If you selected a date or Boolean field in the top scroll box, a 
  2673.     third scroll box appears near the bottom of the dialog box. In this 
  2674.     scroll box, select the date or Boolean condition that finalizes your 
  2675.     summary specification.
  2676.  
  2677. 7.  Select OK when finished. Crystal Reports sorts the data, and then groups 
  2678.     and summarizes it to your specifications. 
  2679.  
  2680. 28.2.29 Grouping and Summarizing Using Nesting Groups
  2681.  
  2682. 1.  Select the field you want to group. 
  2683.  
  2684.     For example:
  2685.  
  2686.     - if you want to group and count a customer list by state and then, 
  2687.     within each state group, group and count the list by city, select 
  2688.     the field that contains the company name, or 
  2689.     - if you want to group and sum an orders report by customer and 
  2690.     then, within each customer group, group and sum the list by date, 
  2691.     select the field that contains the order amount.
  2692.  
  2693. 2.  Select Insert|Summary. 
  2694.     
  2695.     The Insert Summary dialog box appears.
  2696.  
  2697. 3.  In the top scroll box, select the action you want to take on the grouped 
  2698.     data. 
  2699.  
  2700.     For example:
  2701.  
  2702.     - if you want to count the number of values in each group, select 
  2703.     Count, or
  2704.     - if you want to average the values in each group, select Average.
  2705.  
  2706. 4.  In the next scroll box, select the field that you want to trigger a 
  2707.     grouping, whenever its value changes. 
  2708.  
  2709.     For example:
  2710.  
  2711.     - if you want to group a customer list by state, select the state 
  2712.     field, or 
  2713.     - if you want to group an orders report by customer, select the 
  2714.     field that contains the customer name or customer number.
  2715.  
  2716. 5.  In the next scroll box select the sort direction (ascending = A to Z, 
  2717.     0 to 9, descending = Z to A, 9 to 0).
  2718.  
  2719. 6.  If you selected a date or Boolean field in the top scroll box, a third 
  2720.     scroll box appears near the bottom of the dialog box. In this scroll box, 
  2721.     select the date or Boolean condition that finalizes your summary 
  2722.     specification.
  2723.  
  2724. 7.  Select OK when finished. Crystal Reports groups and summarizes the data 
  2725.     to your specifications.
  2726.  
  2727. 8.  Select the same field you selected in Step 1. 
  2728.  
  2729. 9.  Select Insert|Summary. 
  2730.  
  2731.     The Insert Summary dialog box appears.
  2732.  
  2733. 10. Select the action you want to take on the grouped data.
  2734.  
  2735. 11. This time select the field you want to trigger the second group (the 
  2736.     group within the group) whenever its value changes. 
  2737.  
  2738.     For example:
  2739.  
  2740.     - if you want to group and count a customer list by state and then 
  2741.     by city, select the city field, or 
  2742.     - if you want to group and sum an orders report by customer and 
  2743.     then by date, select the date field.
  2744.  
  2745. 12. Select the sort direction (ascending = A to Z, 0 to 9, descending = Z 
  2746.     to A, 9 to 0).
  2747.  
  2748. 13. Select OK when finished. Crystal Reports groups and summarizes the data 
  2749.     to your specifications.
  2750.  
  2751. 14. Repeat Steps 8 to 14 for each additional group you want to set up.
  2752.  
  2753. NOTE:  Group values (subtotals, summaries) and grand totals are 
  2754. automatically formatted to match as closely as possible the formatting of 
  2755. the field they are summarizing.
  2756.  
  2757. 28.2.30 Creating Group Headers
  2758.  
  2759. Just as Crystal Reports allows you to place a header at the top of each 
  2760. page, it also allows you to place incremental headers above each group in 
  2761. your report. This feature allows you to give your reports a polished, 
  2762. professional appearance.
  2763.  
  2764. Whenever you group your data, or insert a subtotal or a summary, Crystal 
  2765. Reports creates two new sections on your report. 
  2766.  
  2767. o  One section, the Group Footer section, appears below the Details section. 
  2768. This section holds the group value field itself.
  2769.  
  2770. o  A matching section, the Group Header section appears above the Details 
  2771. section. Anything you place in this section will appear as a header for your 
  2772. group. 
  2773.  
  2774. NOTE:  Both sections are given the same designation so you can tell that 
  2775. they are tied together. The two sections are also tied together visually.
  2776.  
  2777. o  If you put text in the Group Header section, the same text will appear 
  2778. as a header for each group on the report.
  2779.  
  2780. o  If you put the field in the Group Header section that you use for the 
  2781. sort and group by field, Crystal Reports will create a "live" header for 
  2782. each group. For example, if you have a subtotal that groups your data by 
  2783. Customer, putting a duplicate copy of the Customer field in the Group Header 
  2784. section for that subtotal heads each group with the customer name. You can 
  2785. then format this header field to make it stand out if you wish, using a 
  2786. larger point size, bold face or italics, etc.
  2787.  
  2788. NOTE:  You can hide either the Group Header section or the Group Footer 
  2789. section for any group by activating the Hide Section option available via 
  2790. the Format|Section command.
  2791.  
  2792. 28.2.31 Multiple Groups for the Same Field
  2793.  
  2794. When you set up a second group for the same field, Crystal Reports creates 
  2795. a second group section on your report beneath the first group section. 
  2796. Likewise, it creates a second Group Header section above the first Group 
  2797. Header section. For each new group field section on an existing field, 
  2798. Crystal Reports creates a pair of sections that effectively "bracket" the 
  2799. existing sections. Each section is clearly marked so you can easily tell 
  2800. which header section goes with each group section.
  2801.  
  2802. If you place headers in each of the Group Header sections, you produce a 
  2803. report that is extremely easy to read. For example, if you have grouped your 
  2804. data by State and then by City within each state, each new State section will 
  2805. be headed by a State header, and each City section within the State section 
  2806. will be headed by a City header.
  2807.  
  2808. 28.2.32 Sorting Your Data
  2809.  
  2810. Crystal Reports allows you to sort your data by record and by group. This 
  2811. section discusses each of the sorting procedures in depth.
  2812.  
  2813. NOTE:  Crystal Reports sorts your data using the sorting rules appropriate 
  2814. to the country that you have selected in the International dialog box in the 
  2815. Windows Control Panel.
  2816.  
  2817. 28.2.33 Sorting by Record
  2818.  
  2819. Crystal Reports gives you the ability to sort your data on one or more sort 
  2820. fields. Single and multiple field sorts will be covered in this section.
  2821.  
  2822. Single field sorts are sorts in which all the data in the report is sorted 
  2823. based on the values in a single field. Sorting an inventory report by stock 
  2824. number and sorting a customer list by customer number are examples of single 
  2825. field sorts. 
  2826.  
  2827. In a multiple field sort, Crystal Reports first sorts the entries 
  2828. (alphabetic or numeric) in the first field selected, putting them in 
  2829. ascending or descending order as specified. Then it sorts any entries in 
  2830. the second field that can be sorted without disturbing the sort order of 
  2831. entries in the first field. It then sorts any entries in the third field 
  2832. that can be sorted without disturbing the sort order of the entries in the 
  2833. first two fields. It follows the same pattern for sorting additional fields.
  2834.  
  2835. Use the following procedure to sort by record:
  2836.  
  2837. 1.  Select Print|Record Sort Order. 
  2838.     
  2839.     The Sort Order dialog box appears.
  2840.  
  2841. 2.  Select the Sort Field(s) and Sort Direction you want and click OK 
  2842.     when finished. 
  2843.  
  2844.     Crystal Reports sorts the records to your specifications.
  2845.  
  2846. NOTE:  If you group your data using the Insert|Group, Insert|Subtotal, 
  2847. or Insert|Summary command, Crystal Reports sorts your data automatically, 
  2848. as part of the grouping process. For example, if you sort a customer 
  2849. list by state, Crystal Reports first sorts the list alphabetically by state, 
  2850. before breaking it into state groups. In such a case, you do not need to use 
  2851. the Print|Record Sort Order command to generate the sorting.
  2852.  
  2853. 28.2.34 Sorting Groups
  2854.  
  2855. Crystal Reports allows you to change the order in which groups appear on 
  2856. your report. You can:
  2857.  
  2858. o  base the sort on any group (subtotal or summary) in your report, and
  2859. o  sort your report so that groups appear in ascending or descending order.
  2860.  
  2861. When you group data, Crystal Reports first sorts the data by record and 
  2862. then groups it according to your specifications. Here is some data typical 
  2863. of that found in the {file.STATE} field of a customer list:
  2864.  
  2865. In order to group the data by state, Crystal Reports sorts the original 
  2866. data alphabetically by state, on the first pass, and then it breaks the 
  2867. data into groups (whenever the value in the state field changes) on the 
  2868. second pass. The resulting groups appear in ascending alphabetical order; 
  2869. the group containing all the customers from Arizona comes before the group 
  2870. containing all the customers from Colorado. Now this is fine if you want 
  2871. the groups appearing in that order. But let's assume we want the data 
  2872. grouped so that the group containing the most records (the state with the 
  2873. most customers) appears first, then the state with the second highest 
  2874. number of records, then the third, etc. Crystal Reports lets you do this 
  2875. easily using the Print|Group Sort Order command.
  2876.  
  2877. Use the following procedure to sort groups.
  2878.  
  2879. 1.  Select the Print|Group Sort Order command. 
  2880.  
  2881.     The Sort Order dialog box appears, listing all the groups that you have 
  2882.     set up in your report. In our example above, since customer data is 
  2883.     grouped by state and the number of records in each state group is 
  2884.     counted, a group name similar to this will appear in the Summary Fields 
  2885.     box:
  2886.  
  2887.     Group #n:customer.STATECount of customer.CUSTNAME
  2888.  
  2889.     Translated, this means that the {customer.CUSTNAME} field (the field 
  2890.     that contains the customer name) is grouped and counted every time the 
  2891.     value in the {customer.STATE} field changes.
  2892.  
  2893. 2.  Select this group, click the Add button.
  2894.  
  2895.     Crystal Reports places it in the Sort Fields box and activates the Sort 
  2896.     Direction options.
  2897.  
  2898. 3.  Since you want the largest groups (by count) to appear first and the 
  2899.     smallest last, select Descending. If you wanted the smallest groups 
  2900.     to appear first, you would select Ascending.
  2901.  
  2902. 4.  Click OK when finished. 
  2903.  
  2904.     Crystal Reports sorts the groups to your specifications.
  2905.  
  2906. NOTE:  When you sort by group, nothing happens to the sort order of the 
  2907. records within a group; only the relative positions of the groups 
  2908. themselves change.
  2909.  
  2910. 28.2.35 Hiding Parts of the Report when Printing 
  2911.  
  2912. Crystal Reports has four formatting commands that suppress (hide) various 
  2913. parts of a report. Each of these commands is discussed individually in 
  2914. Crystal Reports Help. The purpose of this section is to show the differences 
  2915. between the commands and how you can use them together to achieve 
  2916. sophisticated report formatting.
  2917.  
  2918. The four commands are:
  2919.  
  2920. Suppress if Duplicated  Suppress if Duplicated (Field format dialog box) 
  2921.             prevents a field value from printing if it is 
  2922.             identical to (a duplicate of) the value that comes 
  2923.             immediately before it. The value doesn't print but 
  2924.             the space in which it would have printed remains.
  2925.  
  2926. Suppress if Zero        Suppress if Zero (Format Number/ Currency dialog 
  2927.             boxes) prevents a value from printing if it is a 
  2928.             zero value. The value doesn't print but the space 
  2929.             in which it would have printed remains.
  2930.  
  2931. Suppress Blank Lines    Suppress Blank Lines (Format Section dialog box) 
  2932.             eliminates nonessential blank lines from your report.
  2933.  
  2934. Hide when Printing      Hide when Printing (Field format dialog box) prevents 
  2935.             a field from printing. The field doesn't print but 
  2936.             the space allotted for the field remains.
  2937.  
  2938. 28.2.36 Selecting Records and Groups to Include on Your Report
  2939.  
  2940. You can include all records in your report, or you can restrict your 
  2941. report to specific records or groups of records. For example, you can 
  2942. print a sales report showing year to date sales for all sales reps in the 
  2943. country, or you can print a report that presents nationwide sales but only 
  2944. for the last month, or even a report that shows year to date sales but 
  2945. only for those sales reps in Texas and California. Your reports can be as 
  2946. inclusive or exclusive as you wish.
  2947.  
  2948. Crystal Reports includes four commands on the Print menu for selecting 
  2949. records and groups.
  2950.  
  2951.     -  Select Records
  2952.     -  Select Groups
  2953.     -  Edit Record Selection Formula
  2954.     -  Edit Group Selection Formula
  2955.  
  2956. o  Using the first two commands, Crystal Reports generates a selection 
  2957. formula for you automatically, based on your specifications.
  2958.  
  2959. o  Using the last two commands, you create your own selection formula 
  2960. using the Formula Editor.
  2961.  
  2962. 28.2.37 Generating a Selection Formula Automatically
  2963.  
  2964. The Select Records and the Select Groups commands automatically generate 
  2965. record selection formulas based on your responses to dialog box questions. 
  2966. These commands require no knowledge of the Crystal Reports formula language.
  2967.  
  2968. When you're using these commands, you select a field/group value and 
  2969. respond to questions about how you want to limit that field or group value. 
  2970. For example, if you want to prepare a report limited to Texas customers, 
  2971. you first click the state field in the customer database. Then, you select 
  2972. Print|Select Records (or choose Select Records from the right mouse button 
  2973. menu). When the Select Records dialog box appears you enter your selection 
  2974. criteria in the dialog box. 
  2975.  
  2976. Use the following procedure to have Crystal Reports generate your selection 
  2977. formula:
  2978.  
  2979. 1.  Select the first field/group value you want Crystal Reports to use 
  2980.     for determining the records/groups to be included in the report.
  2981.  
  2982. 2.  Select Print|Select Records or Print|Select Groups, whichever is 
  2983.     appropriate. 
  2984.  
  2985. NOTE:  Alternately, you can select a field or group value and click the 
  2986. right mouse button menu. Select Records appears on the right mouse button 
  2987. menu whenever a field is selected, and Select Groups appears on the right 
  2988. mouse button menu whenever a group value is selected.
  2989.  
  2990. The Select Records or Select Groups dialog box appears, depending on your 
  2991. selection. 
  2992.  
  2993. 3.  Enter your selection criteria in the dialog box and click OK when 
  2994.     finished to return to the Report Editor.
  2995.  
  2996. 4.  Repeat Steps 1-3 for each additional field/group value you want the 
  2997.     program to use for selecting records/groups.
  2998.  
  2999.     Crystal Reports will generate a selection formula based on your 
  3000.     specifications and limit the report to the records or groups you have 
  3001.     specified.
  3002.  
  3003. NOTE:  To view or edit the selection formula generated by Crystal Reports, 
  3004. select Print|Edit Record Selection Formula or Print|Edit Group Selection 
  3005. Formula, whichever is appropriate to your selection.
  3006.  
  3007. 28.2.38 Creating a Selection Formula Manually
  3008.  
  3009. The Edit Record Selection Formula and Edit Group Selection Formula commands 
  3010. take you to the Formula Editor so you can manually create your own 
  3011. selection formula. Both of these commands require some understanding of the 
  3012. Crystal Reports formula language.
  3013.  
  3014. Using the Formula Editor, you can build a formula that restricts your 
  3015. report to the records or groups you specify. For example, to limit your 
  3016. report to those records with a customer number greater than 099999, you 
  3017. would build a record selection formula similar to this:
  3018.  
  3019.     {file.CustNumb} >> "099999"
  3020.  
  3021. To limit your report to those groups with a subtotal on the Amount column 
  3022. (triggered by changes in the CustNumb field) less than $10,000, you would 
  3023. build a group selection formula similar to this:
  3024.  
  3025.     Sum({file.Amount},{file.CustNumb}) << $10000
  3026.  
  3027. NOTE:  If you select:
  3028.     
  3029.     Grouped by file.CustNumb
  3030.     Sum of file.Amount
  3031.  
  3032. (the group field of interest in this example) from the Field list, Crystal 
  3033. Reports automatically inserts everything into the formula with the exception 
  3034. of <<$10000.
  3035.  
  3036. You can also restrict the records used in the report by date. For example, 
  3037. to restrict an invoice report to invoices from a specific month, May 1991 
  3038. in this case, you would build a record selection formula similar to this:
  3039.  
  3040.     {file.Date}>>=Date(1991,05,01) and 
  3041.     {file.Date}<<Date(1991,06,01)
  3042.  
  3043. or this:
  3044.  
  3045.     {file.Date} in Date(1991,04,30) to Date(1991,06,01)
  3046.     
  3047. or this:
  3048.  
  3049.     Month({file.Date}) = 5
  3050.  
  3051. You can make your selection formulas as simple or complex as you wish. 
  3052. You can use most of the functions and operators available for building any 
  3053. formula. Your only restrictions are:
  3054.  
  3055. o  your record or group selection formula must be Boolean (i.e., it 
  3056. must return a Yes (True) or No (False) value). If you build a selection 
  3057. formula that isn't Boolean, you get a Formula Compiler Error that says, 
  3058. "The result of the selection formula must be a yes/no value."
  3059.  
  3060. o  it cannot use the PageNumber, GroupNumber, or RecordNumber functions, 
  3061. and it cannot use a Subtotal, Grand Total, or Summary.
  3062.  
  3063. 28.2.39 Selecting Date Ranges
  3064.  
  3065. When you wish to select records based on a range of dates, you can use any 
  3066. of Crystal Reports' preset date ranges, or you can build a custom range to 
  3067. fit your needs. For a complete list of Crystal Report date ranges, please 
  3068. see Crystal Reports Help.
  3069.  
  3070. 28.2.40 Generating Your Own Selection Formula
  3071.  
  3072. 1.  Select Print|Edit Record Selection Formula or Print|Edit Group Selection 
  3073.     Formula. 
  3074.  
  3075.     The Formula Editor appears.
  3076.  
  3077. 2.  Create your selection formula.
  3078.  
  3079. 3.  Click Accept when you are finished. 
  3080.  
  3081.     Crystal Reports will limit your report to the records/groups specified.
  3082.  
  3083. NOTE:  You will find a number of selection formula templates in the Help 
  3084. facility under Edit Record Selection Formula. These templates cover a wide 
  3085. range of typical record selection needs, and they can be pasted into the 
  3086. Formula Editor via the Windows clipboard. Once they're in the Formula Editor, 
  3087. you can change the formulas to fit your data.
  3088.  
  3089. 28.2.41 Selecting Page Orientation and Paper Size
  3090.  
  3091. You can use Crystal Reports with a variety of paper sizes and with portrait 
  3092. or landscape page orientation. You select paper sizes and page orientation 
  3093. via the Print Setup dialog box which appears when you select Print|Select 
  3094. Printer.
  3095.  
  3096. Use the following procedure to select a new paper size/page orientation:
  3097.  
  3098. o  To select a new paper size and/or page orientation, you select 
  3099. Print|Select Printer.
  3100.  
  3101. o  When the Print Setup dialog box appears, you activate the printer you 
  3102. want to use if it is not already the default printer.
  3103.  
  3104. o  You select your page orientation (Portrait or Landscape) in the 
  3105. Orientation box, and you select your paper size and source in the Paper 
  3106. box. Your choice of paper sizes depends on the capabilities of the printer 
  3107. you have selected, and the choice changes from printer to printer. 
  3108. For example, the HP LaserJet driver (PCL) offers a choice of letter, legal, 
  3109. executive or A4 paper sizes whereas the PostScript printer driver lets you 
  3110. choose from letter, letter small, legal, A4, A4 small, B5, and note paper 
  3111. sizes. When you make your selection and return to Crystal Reports, the paper 
  3112. you have selected is active.
  3113.  
  3114.  
  3115. 28.3 Manipulating Text and Data
  3116.  
  3117. This section outlines the various procedures to use for manipulating 
  3118. (copying, deleting, moving, etc.) text and data on your report.
  3119.  
  3120. 28.3.1 Adding Text
  3121.  
  3122. To add text, set the insertion point where you want the new text to begin, 
  3123. and type in your addition, or use a text field (Insert|Text Field command).
  3124.  
  3125. 28.3.2 Copying Text
  3126.  
  3127. Use the following procedure to copy text.
  3128.  
  3129. 1.  Select the text you want to copy by dragging the I-beam cursor over the 
  3130.     text.
  3131.  
  3132. 2.  Select Edit|Copy. 
  3133.  
  3134.     Crystal Reports moves a copy of the selected text to the Clipboard 
  3135.     without disturbing the highlighted text.
  3136.  
  3137. 3.  Set the insertion point where you want to insert the copied text and 
  3138.     select Edit|Paste. 
  3139.  
  3140.     Crystal Reports copies the text at the selected point.
  3141.  
  3142. NOTE:  You can also copy text to the Clipboard using the fifth button on 
  3143. the Button Bar. You can also paste text into your report from the clipboard 
  3144. using the sixth button on the Button Bar.
  3145.  
  3146. 28.3.3 Deleting Text
  3147.  
  3148. Use the following procedure to delete text.
  3149.  
  3150. o  set the insertion point where you want to begin deleting, and press the 
  3151. Delete key enough times to delete the unneeded text, or
  3152.  
  3153. o  select the text you want to delete by dragging the I-beam cursor over it, 
  3154. then:
  3155.     - select Edit|Clear (or press Delete) to delete it permanently, or
  3156.     - select Edit|Cut (or press Shift-Delete) to cut the text to the 
  3157.     clipboard for later use, or
  3158.  
  3159. o  set the insertion point at the beginning of a line of text you want to 
  3160. delete and press Shift-End to select the entire line. Then:
  3161.  
  3162.     - select Edit|Clear (or press Delete) to delete it permanently,
  3163.     - or select Edit|Cut (or press Shift-Delete) to cut the text to 
  3164.     the clipboard for later use.
  3165.  
  3166. 28.3.4 Editing Text
  3167.  
  3168. Delete, edit, and/or add text as needed following the techniques described 
  3169. above.
  3170.  
  3171. 28.3.5 Moving Text
  3172.  
  3173. You can move text in Crystal Reports in two different ways:
  3174.  
  3175. o  By pushing or pulling it to a new position using the Tab key.
  3176. o  By cutting it to the clipboard and then pasting it in a new position.
  3177.  
  3178. 28.3.6 Using the Tab Key
  3179.  
  3180. Set the insertion point immediately in front of the text you want to move.
  3181.  
  3182. o  Press the Tab key to move the text to the right. All text to the right 
  3183. of the insertion point moves each time you press the Tab key.
  3184.  
  3185. o  Press the Backspace key to move the text to the left. All text to the 
  3186. right of the insertion point moves each time you press the Tab key.
  3187.  
  3188. NOTE:  If you want to move several pieces of text on a given line into 
  3189. position (i.e., aligning titles with data fields), begin at the left. Move 
  3190. the leftmost text into position, reset the insertion point to the left of 
  3191. the second text element and move it into position, reset the insertion 
  3192. point to the left of the third text element, etc.
  3193.  
  3194. 28.3.6 Using Cut and Paste
  3195.  
  3196. 1.  Select the text you want to move.
  3197.  
  3198. 2.  Select Edit|Cut. 
  3199.  
  3200.     Crystal Reports moves the text to the Clipboard.
  3201.  
  3202. 3.  Set the insertion point to the new text position.
  3203.  
  3204. 4.  Select Edit|Paste to paste the text at the new insertion point.
  3205.  
  3206. 28.3.7 Moving Fields
  3207.  
  3208. You move a database field by dragging it to a new position with the mouse, 
  3209. or by selecting it and using the Arrow keys.
  3210.  
  3211. 28.3.8 Moving Fields with a Mouse
  3212.  
  3213. 1.  Select the field you want to move.
  3214.  
  3215.     o  To select a single field, click the field.
  3216.  
  3217.     o  To select multiple fields, hold the Shift key down while you 
  3218.     click the fields. Handles appear on the selected field(s).
  3219.  
  3220. 2.  With the cursor on the field (on one of the fields if you have selected 
  3221.     multiple fields) and the left mouse button depressed, move the field to 
  3222.     its new position.
  3223.  
  3224. 3.  Release the mouse button when the field is in place.
  3225.  
  3226. 28.3.9 Moving Fields with the Arrow keys
  3227.  
  3228. 1.  Select the field you want to move.
  3229.  
  3230.     o  To select a single field, click the field.
  3231.     o  To select multiple fields, hold the Shift key down while you 
  3232.     click the fields. 
  3233.     
  3234.     Handles appear on the selected field(s).
  3235.  
  3236. 2.  Use the Arrow keys to move the field to its new position. 
  3237.  
  3238. The field moves one grid position each time you press the Arrow key.
  3239.  
  3240. NOTES:  a - Crystal Reports allows you to move fields across other fields 
  3241. without affecting the placement of the bottom fields. 
  3242. b - You can move fields between sections with the following exceptions: 
  3243.     - grand totals cannot be moved outside the Grand Total section, and
  3244.     - a subtotal or summary can be moved only within its initial 
  3245.     section or to the header portion of its initial section.
  3246.  
  3247. 28.3.10 Deleting Fields
  3248.  
  3249. You can delete a database field from your report by selecting it and:
  3250.  
  3251. o  pressing the Delete key on the keyboard, 
  3252. o  selecting Delete Field from the right mouse button pop-up menu, or
  3253. o  selecting Clear from the Edit menu. 
  3254.  
  3255. Each of these methods has the same effect: deleting the selected field. You 
  3256. may find one alternative to be more convenient at one time while a different 
  3257. alternative is more convenient at another.
  3258.  
  3259.  
  3260. 28.4 Working with Graphics and Graphic Enhancements
  3261.  
  3262. This section leads you through the following graphics-related topics:
  3263.  
  3264. o  Bit-mapped graphics concepts,
  3265. o  Inserting and moving graphics,
  3266. o  Sizing and scaling graphics,
  3267. o  Cropping graphics,
  3268. o  Creating, moving, and formatting graphic lines
  3269. o  Creating, moving, and formatting graphic boxes
  3270. o  Using graphic boxes to highlight data
  3271. o  Creating tables using graphic lines and boxes
  3272. o  Graphic elements and the Status Bar
  3273. o  Using the status bar when positioning a graphic element
  3274.  
  3275. 28.4.1 Bit-mapped Graphics Concepts
  3276.  
  3277. Bit-mapped graphics are the kind of graphics (pictures, logos, etc.) that 
  3278. are generally produced by paint programs and scanners. They are composed 
  3279. by the graphic designer as a pattern of tiny dots (pixels) on screen, and 
  3280. they are printed as a pattern of tiny dots on your report. Even though 
  3281. there are some limitations to what an individual can create with dots, a 
  3282. skilled graphics designer can nonetheless achieve some stunning effects 
  3283. that can add visual impact to your report.
  3284.  
  3285. Crystal Reports allows you to use bit-mapped graphics in your reports 
  3286. from a wide variety of sources:
  3287.  
  3288. o  scanners,
  3289. o  paint programs,
  3290. o  video capture cards,
  3291. o  screen capture programs,
  3292. o  CompuServe, 
  3293. o  commercial graphics developers, and
  3294. o  shareware and public domain graphics suppliers.
  3295.  
  3296. As long as the graphic is stored in one of the popular graphics formats 
  3297. that work with Crystal Reports, you can use it in your report. 
  3298.  
  3299.     - Most paint, scanner, screen capture, and video capture programs 
  3300.     can save graphics in one of the compatible file formats (.bmp, 
  3301.     .pcx, .gif, .tif, and .tga).
  3302.  
  3303.     - Additionally, many programs (paint programs, graphics conversion 
  3304.     programs, screen capture programs, draw programs) will allow you to 
  3305.     import a graphic in a different format and save it in a format that 
  3306.     is compatible with Crystal Reports. 
  3307.  
  3308.     - There are, in fact, many low cost shareware programs or free 
  3309.     public domain programs that allow you to easily convert a bit-mapped 
  3310.     graphic stored in one format to another. 
  3311.  
  3312. Crystal Reports was designed for maximum graphics compatibility.
  3313.  
  3314. NOTES:  a - When you select a graphic for inclusion in your report, Crystal 
  3315. Reports stores a copy of the graphic in the report file. Any changes you 
  3316. make to the graphic affect the copy; they do not alter the original.
  3317. b - When you click the right mouse button with the cursor over a graphic, 
  3318. a graphic options menu appears with the name and extension of the originating 
  3319. graphic file at the top. The file name is for information only since the 
  3320. graphic in your report is only a copy of the original. That copy is stored as 
  3321. part of the report and no longer has a separate file name. Any changes you 
  3322. make to the graphic affect the copy only; they do not alter the original.
  3323.  
  3324. 28.4.2 Inserting, Moving, and Deleting Graphics
  3325.  
  3326. Crystal Reports enables you to insert, move, and delete graphics with ease.
  3327. You can insert graphics anywhere you want them to appear on your report.
  3328.  
  3329. Use the following procedure to insert a graphic.
  3330.  
  3331. 1.  Select Insert|Graphic (or click the Insert Graphic button on the 
  3332.     button bar). 
  3333.  
  3334.     The Choose Graphic File dialog box appears. 
  3335.  
  3336. 2.  Select the graphic you want to enter in your report, and click OK when 
  3337.     finished. 
  3338.  
  3339.     Crystal Reports returns you to the Report Editor, and an outline the 
  3340.     size of the graphic appears as an aid in placement.
  3341.  
  3342. 3.  Position the outline where you want the graphic to appear and click the 
  3343.     left mouse button to place it. 
  3344.  
  3345.     Crystal Reports displays the graphic where you placed it.
  3346.  
  3347. You can move a graphic in one of two ways:
  3348. o  using the mouse
  3349. o  using the dialog box
  3350.  
  3351. Move a graphic with the mouse if you want to determine its final placement 
  3352. visually.
  3353.  
  3354. o  To move a graphic using the mouse, click the graphic and, keeping the 
  3355. left mouse button depressed, drag the graphic to the place you want it.
  3356.  
  3357. NOTES:  a - You can move the graphic within its current section, or move 
  3358. it to a new section if you wish. The position of the upper left hand corner 
  3359. of the graphic (not the position of the arrow) determines the section in 
  3360. which the graphic will appear.
  3361. b - Make sure you don't click the graphic on the handles. If you do, you 
  3362. will resize the graphic when you drag it.
  3363.  
  3364. Move a graphic using the dialog box if you want the graphic to appear at 
  3365. an absolute position on your report.
  3366.  
  3367. 1.  Select the graphic you want to move and select Format|Graphic to call 
  3368.     up the Graphic Format dialog box. (Alternately you can double click 
  3369.     the graphic to call up the dialog box or select the graphic and then 
  3370.     select Change Format from the right mouse button menu.)
  3371.  
  3372. 2.  Click the Position button.
  3373.  
  3374.     The Graphic Position dialog box appears. This dialog box indicates the 
  3375.     position of the graphic relative to the top left corner of its section.
  3376.  
  3377.     o  To position the graphic even with the top left corner (the top 
  3378.     flush against the top of the section, the left side flush against 
  3379.     the left side of the section), enter the following settings: 
  3380.     Top 0.00, Left 0.00.
  3381.  
  3382.     o  To move the graphic to the right, increase the Left setting. For 
  3383.     example, to move the graphic in two inches from the left edge of the 
  3384.     section, enter 2.00 for the Left setting (assuming you're working 
  3385.     in inches).
  3386.  
  3387.     o  To move the graphic down in the section, increase the Top setting. 
  3388.     For example, to move the graphic down two inches from the top of 
  3389.     the section, enter 2.00 for the Top setting.
  3390.  
  3391. NOTE:  Crystal Reports automatically resizes the section to accommodate 
  3392. the new graphic location.  
  3393.  
  3394. 3.  Click OK when finished to return to the Graphic Format dialog box, and 
  3395.     click OK once there to return to the Report Editor. 
  3396.  
  3397. Your graphic will be positioned according to your specifications.
  3398. Crystal Reports makes it easy for you to delete a graphic from your report.
  3399.  
  3400. Use the following procedure to delete a graphic.
  3401.  
  3402. 1.  Select the graphic you want to delete.
  3403.  
  3404. 2.  Select Edit|Clear, press the Delete key, or select Delete Graphic from 
  3405.     the right mouse button menu. 
  3406.  
  3407.  
  3408. 28.4.3 Sizing and Scaling Graphics
  3409.  
  3410. Size and Scaling are two interrelated options that appear in the Graphic 
  3411. Format dialog box.  
  3412.  
  3413. o  Size refers to the absolute length and width of a graphic. If the original 
  3414. graphic is one inch wide, it has an absolute width of one inch. If you double 
  3415. the width of the graphic it has an absolute width of two inches.
  3416.  
  3417. o  Scaling refers to the length and width of a graphic as a percentage of 
  3418. the original length and width. If the original graphic is one inch wide, it 
  3419. has a width scaling value of 100%. If you double the width of the graphic, 
  3420. it has a width scaling value of 200%.
  3421.  
  3422. o  When you first place a graphic, Crystal Reports presents it in its 
  3423. original size (the size in which it was saved).
  3424.  
  3425.     - When you change the size values in the Graphic Format dialog box, 
  3426.     Crystal Reports adapts the scaling values to the new height and/or 
  3427.     width. 
  3428.  
  3429.     - When you change the scaling values in that dialog box, the 
  3430.     program adapts the size values to the new height and/or width.
  3431.  
  3432.     - When you resize the graphic using the mouse, the program adapts 
  3433.     the size values and the scaling values in the dialog box to the new 
  3434.     height and/or width.
  3435.  
  3436. When you select a graphic for placement, Crystal Reports presents an 
  3437. outline that indicates the original size of the graphic (the size in which 
  3438. it was saved). When you place the outline, the graphic replaces the frame. 
  3439. You can then enlarge or reduce the size of the graphic to fit your needs. 
  3440.  
  3441. You have two options for doing this:
  3442. o  using the mouse, and
  3443. o  using the Format|Graphic command.
  3444.  
  3445. You can expand or reduce the size of the graphic using a mouse via the 
  3446. sizing handles that appear on the sides and corners of the graphic when you 
  3447. select it. (To select a graphic, you click it with the left mouse button.)
  3448.  
  3449. The sizing handles provide you a very straightforward means of resizing 
  3450. your graphic:
  3451.  
  3452. o  The handles on the right and left sides of the graphic expand or reduce 
  3453. the width of the graphic without affecting the height. For example, if your 
  3454. graphic was a square initially, it becomes a rectangle with the top and 
  3455. bottom becoming longer than the sides (if expanded) or shorter than the 
  3456. sides (if reduced). This kind of sizing results in a graphic that has 
  3457. different proportions than the original. 
  3458.  
  3459. o  The handles on the top and bottom of the graphic expand or reduce the 
  3460. height of the graphic without affecting the width. For example, if your 
  3461. graphic was a square initially, it becomes a rectangle with the sides 
  3462. becoming longer than the top and bottom (if expanded) or shorter than the 
  3463. top and bottom (if reduced). This kind of sizing also results in a graphic 
  3464. that has different proportions than the original. 
  3465.  
  3466. o  The handles on the corners of the graphic expand or reduce the height 
  3467. and width of the graphic equally. If your graphic was originally a square, 
  3468. it remains a square even though it has been resized. This kind of sizing 
  3469. results in a graphic that retains the same proportions as the original.  
  3470.  
  3471. Use the following procedure to resize using a mouse.
  3472.  
  3473. 1.  Click the graphic to select it. Handles appear on the sides and the 
  3474.     corners.
  3475.  
  3476. 2.  Resize the graphic by dragging on the appropriate handle.
  3477.  
  3478.     You can resize your graphic in two different ways using the Graphic 
  3479.     Format dialog box:
  3480.     o  resizing a graphic to an absolute size, and
  3481.     o  scaling a graphic to a percentage of its original size.
  3482.  
  3483. Use the following procedure to resize a graphic to an absolute size.
  3484.  
  3485. 1.  Click the graphic to select it and then select Format|Graphic to call 
  3486.     up the Graphic Format dialog box. 
  3487.  
  3488.     (Alternately you can double click the graphic to call up the dialog 
  3489.     box or select the graphic and then select Change Format from the right 
  3490.     mouse button menu.)
  3491.  
  3492. 2.  Enter the new height and/or width in the Size box.
  3493.  
  3494. 3.  Click OK when finished. 
  3495.  
  3496.     Crystal Reports resizes your graphic to your new specifications.
  3497.  
  3498. Use the following procedure to resize a graphic as a percentage of its 
  3499. original size:
  3500.  
  3501. 1.  Click the graphic to select it and then select Format|Graphic to call 
  3502.     up the Graphic Format dialog box. 
  3503.  
  3504.     (Alternately you can double click the graphic to call up the dialog box 
  3505.     or select the graphic and then select Change Format from the right mouse 
  3506.     button menu.)
  3507.  
  3508. 2.  Enter the new scale value for the height and/or width in the Scaling box.
  3509.  
  3510. 3.  Click OK when finished. 
  3511.  
  3512.     Crystal Reports resizes your graphic to your new specifications.
  3513.  
  3514. NOTES:  a - When you change the Size values, the Scaling values won't 
  3515. change while the dialog box is open. Also, when you change the Scaling 
  3516. values, the Size values won't change while the dialog box is open. The 
  3517. changes will appear the next time you open the dialog box.
  3518. b - Crystal Reports automatically resizes the appropriate report section 
  3519. to accommodate the resized graphic.
  3520.  
  3521. 28.4.4 Cropping Graphics
  3522.  
  3523. Cropping refers to "cutting away" those portions of your graphic that you 
  3524. don't want to print. If, for example, when you scanned your company logo 
  3525. from a letterhead you also scanned in some extraneous material (company 
  3526. address, corporate officers, etc.), you will probably want to "sanitize" 
  3527. the logo before you use it. Using Crystal Reports cropping capability, you 
  3528. can easily cut away the extraneous material leaving only the logo to print.
  3529.  
  3530. There are two ways to crop a graphic:
  3531. o  using the mouse
  3532. o  using the dialog box
  3533.  
  3534. Using the mouse is the easiest way to crop a graphic. It doesn't require 
  3535. any guesswork and you see your results immediately on screen.
  3536.  
  3537. You crop by dragging the resizing handles while depressing the Shift key.
  3538.  
  3539. o  When you drag the top handle down, you cut off part of the top part of 
  3540. the graphic.
  3541. o  When you drag the bottom handle up, you cut off part of the bottom part 
  3542. of the graphic.
  3543. o  When you drag the right side handle to the left, you cut off part of the 
  3544. right side of the graphic.
  3545. o  When you drag the left side handle to the right, you cut off part of the 
  3546. left side of the graphic.
  3547. o  When you drag one of the corner handles into the graphic, you cut off 
  3548. part of two sides of the graphic at once (the top and a side, or the bottom 
  3549. and a side).
  3550. o  When you drag any of the handles away from the graphic (dragging the top 
  3551. handle up, the left handle to the left, etc.) you expand the frame and put 
  3552. white space between the graphic and the frame.  
  3553.  
  3554. Use the following procedure to crop a graphic using the mouse.
  3555.  
  3556. 1.  Select the graphic you want to crop. 
  3557.  
  3558.     Sizing handles appear on the graphic.
  3559.  
  3560. 2.  With the Shift key depressed, crop your graphic by dragging the 
  3561.     appropriate sizing handle(s).
  3562.  
  3563. 3.  When finished, release the Shift key, resize the graphic if needed, 
  3564.     and move the cropped graphic into place.
  3565.  
  3566. NOTE:  Resizing a graphic does not undo the cropping. It simply resizes 
  3567. that portion of the graphic that remains after cropping.
  3568.  
  3569. When you crop a graphic using the dialog box, you specify (in inches or 
  3570. centimeters) the piece of the graphic that Crystal Reports is to cut from 
  3571. the top, bottom, right, and/or left side.
  3572.  
  3573. NOTE:  This method of cropping can be particularly useful if you want to 
  3574. take a specific sized piece off each side of your graphic. For example, if 
  3575. you want to cut exactly one inch off all four sides of your graphic, you 
  3576. can do it more quickly and accurately with the dialog box than the mouse.
  3577.  
  3578. Use the following procedure to crop a graphic using the dialog box.
  3579.  
  3580. 1.  Select the graphic you want to crop and select Format|Graphic to 
  3581.     call up the Graphic Format dialog box. 
  3582.  
  3583.     (Alternately you can double click the graphic to call up the dialog 
  3584.     box or select the graphic and then select Change Format from the right 
  3585.     mouse button menu.)
  3586.  
  3587. 2.  In the Cropping box, enter the amount you want to crop from the Top, 
  3588.     Left, Bottom, and/or right sides of your graphic. 
  3589.  
  3590.     o  Enter positive numbers to cut parts off your graphic. 
  3591.     o  Enter negative numbers to expand the frame, leaving white 
  3592.     space between the frame and the graphic.
  3593.  
  3594. NOTE:  All cropping settings apply to the size of the original graphic. 
  3595. If the graphic has been resized before cropping, make certain you use the 
  3596. Original Size settings as guidelines when entering your new cropping 
  3597. instructions. As a general rule, when you are going to crop and resize a 
  3598. graphic, crop the graphic first, and then resize it. 
  3599.  
  3600. 3.  Click OK when finished. 
  3601.  
  3602.     Crystal Reports returns you to the Report Editor with the Graphic 
  3603.     cropped to your specifications.
  3604.  
  3605. NOTE:  While there are many options in the Graphic Format dialog box, to 
  3606. crop a graphic you only need to concern yourself with the cropping 
  3607. instructions. Crystal Reports automatically maintains the scale and 
  3608. adjusts the absolute size of the graphic so it will display and print to 
  3609. your specifications.
  3610.  
  3611.     -  To restore a cropped graphic to its original size and shape, 
  3612.     change all of the Cropping of original settings to 0.00. 
  3613.  
  3614.     -  To restore a resized graphic to its original size and shape, 
  3615.     change both Scaling settings to 100%.
  3616.  
  3617.     -  To restore a cropped and resized graphic to its original size 
  3618.     and shape, change both the cropping and the scaling settings as 
  3619.     described above.
  3620.  
  3621.  
  3622. 28.4.5 Creating, Moving, and Formatting Lines
  3623.  
  3624. Crystal Reports enables you to create freeform lines that you can use to 
  3625. highlight field data, blocks of data, or entire sections of your report.
  3626.  
  3627. Use the following procedure to create a line.
  3628.  
  3629. 1.  Click Insert|Line. 
  3630.  
  3631.     A pencil cursor appears.
  3632.  
  3633. 2.  Set the tip of the cursor (the pointed end) where you want the line to 
  3634.     begin and drag the cursor horizontally or vertically with the left 
  3635.     mouse button depressed. 
  3636.  
  3637.     The line appears as you drag the cursor. 
  3638.  
  3639. 3.  Release the mouse button when the line is the length you want it.
  3640.  
  3641. NOTE:  To format the line (set line style, width, and color), you use the 
  3642. Format|Line command.
  3643.  
  3644. 28.4.6 Moving a Line
  3645.  
  3646. You can move a graphic line using the mouse, or with the keyboard using the 
  3647. arrow keys.
  3648.  
  3649. Use the following procedure to move a line using the mouse.
  3650.  
  3651. 1.  Click the line to select it.
  3652.  
  3653. NOTE:  When selecting a line or other graphic, the mouse cursor must be an 
  3654. Arrow. Make sure the cursor changes to an arrow before you attempt to 
  3655. select a line.
  3656.  
  3657. 2.  Drag the line where you want it. 
  3658.  
  3659.     Make sure to keep the left mouse button depressed as you move it.
  3660.  
  3661. 3.  Release the mouse button once your line is in position.
  3662.  
  3663. Use the following procedure to move a line with the arrow keys.
  3664.  
  3665. 1.  Click the line to select it.
  3666.  
  3667. 2.  Use the arrow keys to move the line up, down, right, or left and 
  3668.     position it where you want it.
  3669.  
  3670. NOTE:  Crystal Reports displays line coordinates in the Status Bar to help 
  3671. you adjust the size and position of a line. Using the status bar readings, 
  3672. you can easily place a line at a specific location on your report, or 
  3673. align two or more graphic elements with each other.
  3674.  
  3675. 28.4.7 Formatting a Line
  3676.  
  3677. Crystal Reports allows you to specify the style, width, and color for each 
  3678. graphic line you include in your report. You enter your line formatting 
  3679. specifications in the Line Format dialog box.
  3680.  
  3681. Use the following procedure to format a graphic line.
  3682.  
  3683. 1.  Select the line of interest and then select Format|Line. (Alternately, 
  3684.     you can double click the line or select Change Format from the right 
  3685.     mouse button menu.) 
  3686.  
  3687.     The Line Format dialog box appears.
  3688.  
  3689. 2.  Enter your formatting instructions for the line. 
  3690.  
  3691. 3.  Click OK when finished. 
  3692.  
  3693.     Crystal Reports returns you to the Report Editor with the line formatted 
  3694.     to your specifications.
  3695.  
  3696. 28.4.8 Resizing a Line
  3697.  
  3698. Once you have created a line, you can adjust its length using either the 
  3699. mouse or the keyboard arrow keys.
  3700.  
  3701. Use the following procedure to resize a line using the mouse.
  3702.  
  3703. 1.  Select the line you wish to resize.
  3704.  
  3705. 2.  Move the mouse so that the cursor is over one of the square sizing 
  3706.     handles at the endpoints of the line.
  3707.  
  3708. NOTE:  When the mouse cursor is over one of the sizing handles, it changes 
  3709. to a double headed arrow (the Resizing cursor).
  3710.  
  3711. 3.  Drag the handle until the line is the length you want.
  3712.  
  3713. Use the following procedure to resize a line using the arrow keys.
  3714.  
  3715. 1.  Using the mouse, select the line you want to resize.
  3716.  
  3717. 2.  While holding down the Shift key, press: 
  3718.  
  3719.     o  the Right Arrow key to lengthen a horizontal line,
  3720.     o  the Left Arrow key to shorten a horizontal line,
  3721.     o  the Down arrow key to lengthen a vertical line, or
  3722.     o  the Up arrow key to shorten a vertical line.
  3723.  
  3724.  
  3725. 28.4.10 Creating, Moving, and Formatting Boxes 
  3726.  
  3727. Crystal Reports enables you to create free-form graphic boxes that you can 
  3728. use to highlight field data, blocks of data, or entire sections of your 
  3729. report. 
  3730.  
  3731. You can also use graphic boxes by themselves, as stand-alone graphic 
  3732. elements, to add visual interest to your report.
  3733.  
  3734. Use the following procedure to create a box.
  3735.  
  3736. 1.  Click Insert|Box. A pencil cursor appears.
  3737.  
  3738. 2.  Set the tip of the cursor (the pointed end) where you want to anchor 
  3739.     one corner of the box and drag the cursor towards the opposite corner 
  3740.     with the left mouse button depressed. 
  3741.  
  3742.     The box appears as you drag the cursor. 
  3743.  
  3744. 3.  Release the mouse button when the box is the size you want it.
  3745.  
  3746. NOTE:  To format the box (set line style and width, line color, etc.), 
  3747. you use the Format|Box command.
  3748.  
  3749. 28.4.11 Moving a Box
  3750.  
  3751. You can move a graphic box using the mouse, or with the keyboard arrow keys.
  3752. Use the following procedure to move a box using the mouse.
  3753.  
  3754. 1.  Click the box to select it.
  3755.  
  3756. NOTE:  You can select a box only with an arrow cursor. Position the I-beam 
  3757. near the box edge until it changes to an arrow and then click the edge of 
  3758. the box (not the center) to select it.
  3759.  
  3760. 2.  Drag the box where you want it. 
  3761.  
  3762.     Make sure to keep the left mouse button depressed as you move it.
  3763.  
  3764. 3.  Release the mouse button once your box is in position.
  3765.  
  3766. Use the following procedure to move a box with the arrow keys.
  3767.  
  3768. 1.  Click the box to select it.
  3769.  
  3770. 2.  Use the arrow keys on the keyboard to move the box up, down, right, or 
  3771.     left until it is in the position that you want.
  3772.  
  3773. NOTE:  Crystal Reports displays box coordinates in the Status Bar to help 
  3774. you adjust the size and position of a graphic box. Using the status bar 
  3775. readings, you can easily place a box at a specific location on your report, 
  3776. or align two or more boxes with each other.
  3777.  
  3778. 28.4.12 Formatting a Box
  3779.  
  3780. Crystal Reports allows you to change:
  3781.  
  3782. o  the box style (the kind of line that outlines the box: single solid 
  3783. line, single dashed line, etc.), 
  3784. o  the width (thickness) of the line that outlines the box, and
  3785. o  the color of the line that outlines the box.
  3786. o  Additionally, you can specify the fill for the box (whether the box 
  3787. is filled with a color or empty). 
  3788.  
  3789. You enter your box formatting specifications in the Box Format dialog box.
  3790. Use the following procedure to format a box.
  3791.  
  3792. 1.  Select the box of interest and then select Format|Box. 
  3793.  
  3794.     (Alternately, you can double click the box or select Change Format 
  3795.     from the right mouse button menu.) 
  3796.  
  3797.     The Box Format dialog box appears.
  3798.  
  3799. 2.  Enter your formatting instructions for the box. 
  3800.  
  3801. 3.  Click OK when finished. 
  3802.  
  3803.     Crystal Reports returns you to the Report Editor with the box formatted 
  3804.     to your specifications.
  3805.  
  3806. 28.4.13 Resizing a Box
  3807.  
  3808. Once you have created a box, you can adjust its size using either the 
  3809. mouse or the keyboard arrow keys.  Use the following procedure to resize a
  3810. box using the mouse.
  3811.  
  3812. 1.  Select the box you wish to resize.
  3813.  
  3814. 2.  Move the cursor over one of the square sizing handles.
  3815.  
  3816. NOTE:  When the cursor is over one of the sizing handles, it changes to 
  3817. a double headed arrow (the resizing cursor).
  3818.  
  3819. 3.  Drag the handle until the box is the size you want:
  3820.  
  3821.     o  If you want to change the height of the box, drag the handle at 
  3822.     the top or the bottom. 
  3823.     o  If you want to change the width of the box, drag the handle at 
  3824.     the right or the left side. 
  3825.     o  If you want to change both the height and the width at the 
  3826.     same time, drag one of the handles at the corners of the box.
  3827.  
  3828. Use the following procedure to resize a box using the arrow keys.
  3829.  
  3830. 1.  Using the mouse, select the box you want to resize.
  3831.  
  3832. 2.  While holding down the Shift key, press: 
  3833.  
  3834.     o  the Right Arrow key to make the box wider,
  3835.     o  the Left Arrow key to make the box narrower,
  3836.     o  the Down arrow key to make the box taller, or
  3837.     o  the Up arrow key to make the box shorter.
  3838.  
  3839.  
  3840.